@kkostenko opened this Issue on November 27th 2018

Hello!

I have both matomo and mysql running in docker containers on my MacBook the following way:
docker run --name mysql_matomo -p 3306:3306 -p 33060:33060 -e MYSQL_ROOT_PASSWORD=supersecretpassword -d mysql
docker run -d --link mysql_matomo --name matomo -p 80:80 -p 443:443 matomo

mySQL is accessible just fine from mySQL Workbench on the same MAC.
I created piwik DB on mySQL successfully.

However, during matomo installation process if I use 127.0.0.1 address for DB server I gets the following error:
Error while trying to connect to the database server: SQLSTATE[HY000] [2002] Connection refused
If I use "localhost", I am getting another one:
Error while trying to connect to the database server: SQLSTATE[HY000] [2002] No such file or directory

Any idea what can be wrong here?

@fdellwing commented on November 27th 2018 Contributor

SQLSTATE[HY000] [2002] Connection refused

This hints, that you are indeed able to reach the server, but it is not allowing the access. So, the next logical step would be to check the log of the mysql server for the reason it does not allow the connection.

@kkostenko commented on November 27th 2018

well, as I mentioned, I can access mySQL server otherwise, only matomo fails to do though. The logs are not helpful:
$docker logs 7ad7364fdb57 | tail
2018-11-27T13:40:26.881387Z 0 [Warning] [MY-010315] [Server] 'user' entry 'mysql.infoschema@localhost' ignored in --skip-name-resolve mode.
2018-11-27T13:40:26.881471Z 0 [Warning] [MY-010315] [Server] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode.
2018-11-27T13:40:26.881505Z 0 [Warning] [MY-010315] [Server] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
2018-11-27T13:40:26.881538Z 0 [Warning] [MY-010315] [Server] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
2018-11-27T13:40:26.881602Z 0 [Warning] [MY-010323] [Server] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode.
2018-11-27T13:40:26.881627Z 0 [Warning] [MY-010323] [Server] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
2018-11-27T13:40:26.881695Z 0 [Warning] [MY-010311] [Server] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
2018-11-27T13:40:26.886696Z 0 [Warning] [MY-010330] [Server] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode.
2018-11-27T13:40:26.886767Z 0 [Warning] [MY-010330] [Server] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
2018-11-27T13:40:26.895641Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.13' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL.
2018-11-27T13:40:26.985330Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock' bind-address: '::' port: 33060
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
Initializing database
Database initialized
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...

MySQL init process done. Ready for start up.

$

@kkostenko commented on November 27th 2018

ok, I figured it out. Instead of 127.0.0.1 I need to use a real IP of the MAC host. Otherwise matomo/piwik tries to access a service within matomo container looks like.

This Issue was closed on November 27th 2018
Powered by GitHub Issue Mirror