How to start mysql in docker


 description

Start the mysql container in docker

 command

docker run -p 3306:3306  --restart=always  --privileged=true --name mysql -e MYSQL_ROOT_PASSWORD="cmdhelp" -d mysql

 parameter

-p :  Publish the port of the container to the host
--restart :  restart strategy
--privileged :  grant extended privileges to this container
--name :  specify a name for the container
-d :  Run the container in the background and print the container ID
MYSQL_ROOT_PASSWORD :  mysql default password

I hope to help every developer quickly find the commands they need. Of course, you can also add your own commonly used commands for easy searching.