This article mainly introduces the installation and configuration method of mysql 8.0.20 under docker

Juejin. Cn/post / 695980…

Before you start, xiaobian recommended to everyone a set of zero basic introduction Docker tutorial, just started to learn students can directly click 👇 to watch oh

Online viewing link:

I.bjpowernode.com/courses/4.h…

Information, source code download:

www.bjpowernode.com/javavideo/1…

Pull the mirror

Docker search mysql docker pull mysqlCopy the code

Look at mirror

docker images
Copy the code

Specify a custom network

Docker network create --subnet=172.10.0.0/16 mynetworkCopy the code

View user-defined networks

docker network ls
Copy the code

Delete a user-defined network

Docker network rm mynetworkCopy the code

Create MySQL container

Remember to set a password here

Docker run -itd --name mysql-master -p 3306:3306 --net mynetwork -- IP 172.10.0.2 -e MYSQL_ROOT_PASSWORD=123456 mysqlCopy the code

Check the container

docker ps -a
Copy the code

Into the container

docker exec -it da30bacb60fd /bin/bash
Copy the code

And then it goes into a MySQL container

Check out our version of MySQL

— — — — — — — —

The original link: blog.csdn.net/fangkang7/a…