How to start mysql in docker


Start the mysql container in docker


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


-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
Was this helpful?

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.