Mac Docker install mysql

One, view docker status

$ docker image ls

2. Pull MySql image from Docker

$ docker pull mysql

(If you want to pull the specified version, you can go to https://hub.docker.com/_/mysql?tab=tags to select the specified version to download)

 

$ docker image ls

 

  • Create and start the MySQL container

$ docker run --name itxing-mysql -e MYSQL_ROOT_PASSWORD=123456 -p 3306:3306 -d mysql

(123456 is the password of the root user)

$ docker ps // View the running status of the container

 

Fourth, test link MySQL

 

If there is a problem with the connection, please refer to

https://www.jianshu.com/p/d211fec2f34a

If you need to install other software, please refer to

https://www.runoob.com/docker/docker-install-mysql.html

Guess you like

Origin blog.csdn.net/wangpei930228/article/details/108409472