I have setup docker container with mysql that expose 3306.
I\'ve specified database user, database password and create a test db and give the privileges to new user.
In
The --link flag is considered a legacy feature, you should use user-defined networks.
You can run both containers on the same network:
docker run -d --name php_container --network my_network my_php_image
docker run -d --name mysql_container --network my_network my_mysql_image
Every container on that network will be able to communicate with each other using the container name as hostname.