Deploy MySQL Server on Docker in less than 3 minutes

mkdir -p $HOME/docker/persistent_volumes/mysql

docker pull mysql/mysql-server:latest

docker run –name mysql-server-docker -d -p 3306:3306 -v $HOME/docker/persistent_volumes/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=mypassword mysql/mysql-server:latest –default_authentication_plugin=mysql_native_password

docker logs mysql-server-docker

docker exec -it mysql-server-docker mysql -uroot -p

docker container list

docker stop mysql-server-docker

docker container ls -a

docker container rm mysql-server-docker

docker image list

docker image remove mysql/mysql-server