pull latest mysql,使用navicat 连接一直搞不定,最后docker pull mysql:5.5 轻松连接,
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/tomcat latest df50c9d355cf 4 days ago 463 MB
docker.io/mysql 5.5 acfff6acec30 4 days ago 205 MB
[root@localhost ~]# clear
[root@localhost ~]# docker run -p 3306:3306 --name mysql01 -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.5
848c6f7606082547b28d3eba9f693f8518ae3ac368db22ca7ce4d5bcbca97706
[root@localhost ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
848c6f760608 mysql:5.5 "docker-entrypoint..." 8 seconds ago Up 8 seconds 0.0.0.0:3306->3306/tcp mysql01
参考 https://hub.docker.com/_/mysql/ 下载mysql镜像
[root@localhost ~]# docker pull mysql
How to use this image
Start a mysql server instance
... where some-mysql is the name you want to assign to your container, my-secret-pw is the password to be set for the MySQL root user and tag is the tag specifying the MySQL version you want. See the list above for relevant tags.