Navicate连接docker 容器内的mysql数据库
1、拉取镜像$docker pull mysql

4、连接测试一1. mysql连接IP问题首先这个IP肯定不是localhost,然后以为是mysql容器的IP查看mysql容器的ipdocker inspect <container-ID> | grep IPAddress结果是:192.168.48.4但是还是连接不上

5、连接测试二2 获取docker主机 IP$ ifconfig | grep inet结果是:10.2.114.3

6、连接mysql 8提示2059 - authentication plugin 'caching_sha2_password...原因:由于myslq8不髹瑕扔麝支持动态修改密码验证方式解决方案:1,进入mysql容器docker exec -it mysql-test bash2,连接mysqlmysql -uroot -p3,修改配置use mysql;ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new password';FLUSH PRIVILEGES;