[root@master ~]# docker ps |grep mysql
860b9dffae92 registry.cn-beijing.aliyuncs.com/qingfeng666/mysql:5.7 "docker-entrypoint.s…" 9 months ago Up 15 hours 0.0.0.0:3306->3306/tcp, 33060/tcp mysql57
[root@master ~]# netstat -nap |grep 3306
tcp6 0 0 :::3306 :::* LISTEN 28686/docker-proxy
unix 2 [ ] DGRAM 33064 1032/kubelet @0001b
[root@master ~]# telnet 127.0.0.1 3306
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
J
5.7.32b%p+Yn&ÿ!QT\!8e
eQ,mysql_native_passwordXshell
进入容器:
[root@master ~]# docker exec -it 860b9dffae92 sh