时间:2021-07-01 10:21:17 帮助过:48人阅读
[root@localhost ~]# docker run -p 3306:3306 --name mysql01 -e MYSQL_ROOT_PASSWORD=123456 -d mysql
navicat远程连接mysql的时候,会提示以下错误:
1251-Client does not support authentication protocol requested by server; consider upgrading MySQL client
[root@localhost ~]# docker exec -it mysql01 bash
root@9c99a69a5b50:/# mysql -uroot -p
mysql> select host,user,plugin,authentication_string from mysql.user;
备注:host为 % 表示不限制ip localhost表示本机使用 plugin非mysql_native_password 则需要修改密码
mysql> alter user ‘root‘@‘%‘ identified with mysql_native_password by ‘123456‘;
Query OK, 0 rows affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
连接成功
虚拟机中docker安装mysql远程无法访问
标签:docker string nav -name 背景 cat not nat http