Error connecting to MySQL with PHP and Docker

0

I'm running Docker and in the settings correctly step the credentials for the connection to MySQL (MariaDB), however it always returns the following error:

http://localhost/error.php?err=Unable%20to%20connect%20to%20MySQL

That is, 'Unable to connect to MySQL'.

In the Docker settings file, credentials are as follows:

HOST = localhost USER = root PASSWORD = password DATABASE = db

The password is different from the one being entered above. I'm using Ubuntu and I've even created another user with the same root privileges, but it's always the same.

When I access MySQL through DBeaver informing the credentials it can access it normally and perform all operations, it is only when you load Docker and try to open in the browser that these problems happen.

    
asked by anonymous 13.07.2018 / 18:43

1 answer

1

I was able to solve the problem by uploading a container of MariaDB along with the other containers I was already using and I used the Portainer tool to manage the containers and see which ip's and ports to direct.

    
17.07.2018 / 19:17