28 2023-09-20 10:51:40 docker run -p 10050:3306 –name mysql-master -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7
29 2023-09-20 10:51:46 docker ps
30 2023-09-20 10:58:36 docker run -p 10051:3306 –name mysql-slave -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7
31 2023-09-20 10:58:40 docker ps
32 2023-09-20 10:59:24 docker stop 5625ef232439
33 2023-09-20 10:59:31 docker rm 5625ef232439
34 2023-09-20 10:59:37 docker images
35 2023-09-20 10:59:40 docker ps
36 2023-09-20 11:00:14 ping 182.61.40.160
37 2023-09-20 11:02:55 docker exec -it mysql-master /bin/bash
38 2023-09-22 13:32:45 history
[root@VM-0-16-centos ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
45c7388bedfd mysql:5.7 “docker-entrypoint…” 2 days ago Up 2 days 33060/tcp, 0.0.0.0:10050->3306/tcp mysql-master
7 root 2023/09/20 10:59:54 docker run -p 10051:3306 --name mysql-slave -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7
8 root 2023/09/20 10:59:59 docker ps
9 root 2023/09/22 13:32:51 history
[root@ls ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
66c10db339b8 mysql:5.7 “docker-entrypoint…” 2 days ago Up 2 days 33060/tcp, 0.0.0.0:10051->3306/tcp mysql-slave
连一下
没问题