docker 安装mysql8 navicat连接 解决1251 client does not support ..问题

本文参照:https://blog.****.net/qq_22211217/article/details/80415248

 

1、进入容器

      执行命令:docker exec -it d27bd3008ad9 /bin/bash

docker 安装mysql8 navicat连接 解决1251 client does not support ..问题

2、登录mysql

    执行命令:mysql -uroot -p

   docker 安装mysql8 navicat连接 解决1251 client does not support ..问题

   会让输入密码。注意输入密码是不显示的,正常输入,按回车

   docker 安装mysql8 navicat连接 解决1251 client does not support ..问题

登录进来了

3、查看用户信息

  执行命令:select host,user,plugin,authentication_string from mysql.user;

docker 安装mysql8 navicat连接 解决1251 client does not support ..问题

备注:host为 % 表示不限制ip   localhost表示本机使用    plugin非mysql_native_password 则需要修改密码

4、修改用户密码

  执行命令:ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'newpassword';

  ps: root用户密码为newpassword

5、刷新退出

执行命令:(1)刷新:FLUSH   PRIVILEGES;

                  (2)退出:exit;

6、退出docker容器

 ctrl+p+q

 

以上全部内容为个人愚见,有不正确的欢迎指正!

个人邮箱:[email protected] 欢迎交流学习!!