Docker Community Forums

Share and learn in the Docker community.

Wordpress, Mysql and a Volume

docker

(Bligoubloups) #1

Hi !
I’m trying to link mysql container to wordpress container.
And im using a volume for mysql that seems to break everything.

I create a volume :
docker volume create vol
Then I create a container mysql:
docker run -d --restart on-failure -e “MYSQL_ROOT_PASSWORD=password” --name sql -v vol:/var/lib/mysql mysql:5.7
And finally a container wordpress:
docker run --name wp --link sql:mysql -p 8080:80 -d wordpress

With
docker logs wp
I get

Warning: mysqli::__construct(): (HY000/2054): The server requested authentication method unknown to the client in Standard input code on line 22

MySQL Connection Error: (2054) The server requested authentication method unknown to the client

If I remove -v vol:/var/lib/mysql when creating mysql container, it works.

So my question is how can I make it work with a volume ?

Thank you !