Skip to content
Advertisement

docker-compose: cannot access to phpMyAdmin from my LEMP stack

I just created a LEMP stack (Linux, Nginx, MariaDB, PHP-FPM) with docker and docker-compose. But somehow, I cannot access to my database trough phpMyAdmin.

When I’m trying to reach the phpMyAdmin web-server, I got these errors:

MySQL said: Documentation

Cannot connect: invalid settings.

Packets out of order. Expected 0 received 1. Packet size=69

mysqli_real_connect(): Error while reading greeting packet. PID=18

mysqli_real_connect(): (HY000/2006): MySQL server has gone away

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

The rest is working fine.

Here is my docker-compose.yml file:

JavaScript

And here is my Dockerfile:

JavaScript

Thank you for your help in advance.

Advertisement

Answer

connect all your service together using networks

docker-compose.yml

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement