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 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.
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.