0

I have searched for this question on the internet, but found only topics the other way around. (connecting to a mariadb in a docker container).

I'm in the process of installing nextcloud in conjuction with onlyoffice. Now i need to configure a db. I could go with sqlite, but don't want to use that for this.

MariaDB runs fine, it's listening (netstat -antup | grep 3306):

tcp       0     0 127.0.0.1:3306        0.0.0.0:*           LISTEN      4880/mysqld

But nextcloud keeps saying:

Error while trying to create admin user: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] Connection refused

I have created the database and user and granted this user the nessesary permissions according to the nextcloud documentation.

At the database field i just enter: 127.0.0.1:3306

I just can't figure out why it doesn't connect, any ideas?

If you want the config i can give it you, but it's nothing special, just standard config with two rows extra because nextcloud requires the following:

transaction_isolation = READ-COMMITTED
binlog_format = ROW

Thanks for your help!

Best Regards,

Mart1250

Mart1250
  • 3
  • 1

1 Answers1

0

As I can see from your description you have the MariaDB on the host and the NextCloud inside a docker

  • you can't reach the host network socket from inside the docker machine but if you want to do so you can configure the docker to use the host network as mentioned in the following answer
  • Or you can mount the MariaDB unix socket inside the docker and configure it as mentioned in NextCloud tutorial
Kerolos William
  • 305
  • 1
  • 13
  • 1
    Although extremely late, thanks for your answer! I fixed it with running mariadb as well in a docker container. – Mart1250 Mar 11 '19 at 11:36