0
I am running the Docker and in the settings step correctly the credentials for the connection to Mysql(Mariadb), but 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 are the credentials:
HOST=localhost USER=root PASSWORD=password DATABASE=db
The password is different from the one being informed above. I’m using Ubuntu and I’ve even created another user with the same root privileges, but always happens the same thing.
When I access Mysql by Dbeaver stating the credentials it can access normally and perform all operations, it is only when loading the Docker and try to open in the browser that these problems happen.
Please demonstrate the code used to connect to the server.
– Jorge Costa
The PHP application is running in another container - or the same - or is running from host? Include your Compose - by the tag you are using Compose -, dockerfile, what is needed to reproduce the problem.
– Bruno César
I managed to solve my problem by uploading an image of Mariadb along with PHP and HTTPD on Docker, I will add as an answer if someone also needs.
– LeonardoEbert