zoukankan      html  css  js  c++  java
  • docker mysql authentication_string client does not support authentication 连接问题

    docker安装mysql后,本地navicat连接报错client does not support authentication

    解决办法:

    1. docker ps -a 查找到容器id

    2. docker exec -it id /bin/bash 进入mysql容器 

    3.mysql -u root -proot登陆mysql

    此处比较奇怪,我在docker中启动mysql容器指定密码是123456但是123456登陆不了,使用密码root可以登陆

    4.use mysql; 进入mysql

    5.查询用户表信息:

    select host,user,authentication_string from user ; 

    6.更改host为% user为root的用户的authentication_string

    host为%大家可以百度一下,说是方便远程连接

    update user set authentication_string = 'root' where user = 'root' and host = '%';

    update user set authentication_string = 'root' where user = 'root' and host = 'localhost';

    7.如果还不行使用下面语句:

    alter user 'root'@'localhost' identified with mysql_native_password by '123456';

    alter user 'root'@'%' identified with mysql_native_password by '123456';

    然后navicat登陆就成功啦

  • 相关阅读:
    03server
    Storm介绍(一)
    storm总结
    Spring源码分析(七)扩展接口BeanPostProcessors源码分析
    技术大牛养成指南
    02装配bean
    02Activity
    maven构建项目
    IDEA使用
    从GIt上导出Maven项目
  • 原文地址:https://www.cnblogs.com/ph7seven/p/9261433.html
Copyright © 2011-2022 走看看