Xibo CMS unable accessing mysql docker instance

Some additional detail:

from the command line of the docker xibo-docker-239_cms-web_1, I tried the following commands:

mysql -u cms -p -h mysql
Enter password:

ERROR 2005 (HY000): Unknown MySQL server host 'mysql' (-3)

So the issue can be reproduced inside both

  • xibo-docker-239_cms-web_1
  • xibo-docker-2310_cms-web_1

However, performing command:
mysql -u cms -p -h 127.0.0.1

inside the xibo-docker-239_cms-db_1, connection is successful, so the mysql instance inside that apps is working fine.

Finally, performing command:
docker inspect xibo-docker-239_cms-db_1

I found the IPAddress associated with the mysql apps container (172.18.0.3).
Therefore, in the command line of docker xibo-docker-239_cms-web_1, I performed following command:

mysql -u cms -p -h 172.18.0.3

and it works fine.

So it really seems that the name “mysql” is not visible to the xibo-docker-239_cms-web_1 instance.

If anyone is able to provide some hint about how to fix the “by name” connection to mysql apps, it could be really useful.

If I have any update I will post additional info, in order to share interesting details to other customers.

Best regards

1 Like