0

I’m an Owncloud newbie and would like to deploy a containerized version of Owncloud on my NAS (QNAP) as a private alternative to Dropbox. I can run a docker container of Owncloud without any problem using the default sqlite database: I access the GUI, create the admin user, browse the file structure, etc. But I’d like to switch to Mysql and I was so far unable to do as Owncloud “seems” to ignore the settings in config.php.

I created a MySQL instance (MariaDB) in a separate container and added an empty owncloud-reserved database to it: I verified that from the Owncloud container I can successfully login into the MySQL’s via the command line using the appropriate credentials, so the database is reachable.

Following some instructions I found online I edited file config.php and changed field “installed” in variable $CONFIG from “true” to “false”: this triggers the db configuration wizard upon login. In the wizard I select “MySQL” and await the completion of the setup procedure. When it’s done I checked that:

  1. Owncloud tables have been created in the MariaDB database (the db was empty before running the wizard)

  2. The config.php file has been modified and now I see all mysql db settings, particulary: 'dbtype' => 'mysql', (the file showed before the sqlite settings)

So apparently the wizard did his stuff.

Despite the above, if I go to the Settings page of my admin user, under General I still see the red warning: “<code>SQLite is used as database…etc”. For testing, I added a new user and indeed the data are still stored in the sqlite file rather than MySQL

So my conclusion is that Owncloud is ignoring config.php in my setup.

Things I tried to no avail:

Recreating the Owncloud container multiple times Restart the container after the database change Running the suggested sqlite to mysql migration script as per the owncloud official documentation

What am I missing? Thanks in advance Regards Sergio

4

1 回答 1

0

问题解决了。将以下具有适当值的变量添加到容器的环境中就可以了:

OWNCLOUD_DB_TYPE=mysql
OWNCLOUD_DB_HOST=name or ip of the host (container) where the db is running
OWNCLOUD_DB_NAME=name of the database
OWNCLOUD_DB_USERNAME=name of the user to authenticate with (must have full privs on the db)
OWNCLOUD_DB_PASSWORD=its password

谢谢S。

于 2020-12-25T10:35:44.750 回答