➜ ~ docker search mysql NAME DESCRIPTION STARS OFFICIAL AUTOMATED mysql MySQL is a widely used, open-source relation… 9673 [OK] mariadb MariaDB is a community-developed fork of MyS… 3518 [OK] mysql/mysql-server Optimized MySQL Server Docker images. Create… 705 [OK] centos/mysql-57-centos7 MySQL 5.7 SQL database server 77 mysql/mysql-cluster Experimental MySQL Cluster Docker images. Cr… 70 centurylink/mysql Image containing mysql. Optimized to be link… 61 [OK] ....
MYSQL_ROOT_PASSWORD=123456:设置 MySQL 服务 root 用户的密码。
1 2 3 4
# 查看是否安装成功 ➜ ~ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a96f3f885216 mysql "docker-entrypoint.s…"16 hours ago Up 21 minutes 0.0.0.0:3306->3306/tcp, 33060/tcp mysql-test
切换到MySQL镜像,登录MySQL
1
docker exec -it mysql-test bash
登录MySQL
1
mysql -u root -p 123456
Navicat 连接Docker MySQL
连接报错信息
1
2059 - Authentication plugin 'caching_sha2_password' cannot be loaded: dlope
查看mysql版本
1 2 3 4 5 6 7
mysql> select version(); +-----------+ | version() | +-----------+ | 8.0.20 | +-----------+ 1 row in set (0.00 sec)