Setting up MySQL docker container with phpMyAdmin.

Spinning MySQL docker container

On WIndows10. Just make sure to change “SYMFONY” to your actual Windows username.
MySQL database should be saved in “downloads” directory.

Docker setup MySQL with phpMyAdmin on Windows10/11
docker run --name mysql-server_v2 -d --restart=unless-stopped -v C:\Users\SYMFONY\downloads\database\mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=rootp -e MYSQL_USER=user1 -e MYSQL_PASSWORD=user1p -e MYSQL_DATABASE=projectX mysql:5.7.29

Spinning phpMyAdmin Docker container with association to MySQL database.

docker run --name phpmyadmin_v2 -d --link mysql-server_v2:db -p 8080:80 phpmyadmin/phpmyadmin

Check containers with docker ps

Now open browser and navigate to http://localhost:8080/. Enter username and password. For root access, login as:

root
rootp

or use created user:

user1
user1p

After passing in the above credentials, you will be connected to MySQL database through phpMyAdmin interface.

Docker setup MySQL with phpMyAdmin on Windows10/11

If you’re interested in setting up a full LAMP stack (Linux, Apache MySQL, PHP) check out docker compose repo sprintcube/docker-compose-lamp for instructions.

0
Would love your thoughts, please comment.x
()
x