MYSQL出现" Client does not support authentication "的解决方法

所属分类: 数据库 / Mysql 阅读数: 752
收藏 0 赞 0 分享

MYSQL 帮助:

A.2.3 Client does not support authentication protocol

MySQL 4.1 and up uses an authentication protocol based on a password hashing algorithm that is incompatible with that used by older clients. If you upgrade the server to 4.1, attempts to connect to it with an older client may fail with the following message:

shell> mysql
Client does not support authentication protocol requested
by server; consider upgrading MySQL client

To solve this problem, you should use one of the following approaches:

  • Upgrade all client programs to use a 4.1.1 or newer client library.
  • When connecting to the server with a pre-4.1 client program, use an account that still has a pre-4.1-style password.
  • Reset the password to pre-4.1 style for each user that needs to use a pre-4.1 client program. This can be done using the SET PASSWORD statement and the OLD_PASSWORD() function:
    mysql> SET PASSWORD FOR
      -> 'some_user'@'some_host' = OLD_PASSWORD('newpwd');
    Alternatively, use UPDATE and FLUSH PRIVILEGES:
    mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd')
      -> WHERE Host = 'some_host' AND User = 'some_user';
    mysql> FLUSH PRIVILEGES;
    Substitute the password you want to use for ``newpwd'' in the preceding examples. MySQL cannot tell you what the original password was, so you'll need to pick a new one.
  • Tell the server to use the older password hashing algorithm:
    1. Start mysqld with the --old-passwords option.
    2. Assign an old-format password to each account that has had its password updated to the longer 4.1 format. You can identify these accounts with the following query:
      mysql> SELECT Host, User, Password FROM mysql.user
        -> WHERE LENGTH(Password) > 16;
      For each account record displayed by the query, use the Host and User values and assign a password using the OLD_PASSWORD() function and either SET PASSWORD or UPDATE, as described earlier.

For additional background on password hashing and authentication, see section 5.5.9 Password Hashing in MySQL 4.1.

更多精彩内容其他人还在看

MySQL查询和修改auto_increment的方法

这篇文章主要介绍了MySQL查询和修改auto_increment的方法,实例分析了select查询auto_increment及ALTER修改auto_increment的技巧,需要的朋友可以参考下
收藏 0 赞 0 分享

mysql的左右内连接用法实例

这篇文章主要介绍了mysql的左右内连接用法,以一个完整实例较为详细的分析了mysql的左右内连接使用技巧,具有一定参考借鉴价值,需要的朋友可以参考下
收藏 0 赞 0 分享

mysql 查询重复的数据的SQL优化方案

这篇文章主要介绍了mysql 查询重复的数据的SQL优化方案,非常不错的方案推荐给大家。
收藏 0 赞 0 分享

MySQL左联多表查询where条件写法示例

这篇文章主要介绍了MySQL左联多表查询where条件写法示例,本文直接给出写法示例,需要的朋友可以参考下
收藏 0 赞 0 分享

Mysql修改datadir导致无法启动问题解决方法

这篇文章主要介绍了Mysql修改datadir导致无法启动问题解决方法,本文原因是SELINUX导致,用关闭SELINUX的方法解决了这个问题,需要的朋友可以参考下
收藏 0 赞 0 分享

Centos中彻底删除Mysql(rpm、yum安装的情况)

这篇文章主要介绍了Centos中彻底删除Mysql(rpm、yum安装的情况),本文直接给出操作代码,需要的朋友可以参考下
收藏 0 赞 0 分享

mysql误删root用户恢复方法

这篇文章主要介绍了mysql误删root用户恢复方法,本文操作是在mysql5.5版本下完成,其它版本仅作参考,需要的朋友可以参考下
收藏 0 赞 0 分享

MySQL编程中的6个实用技巧

这篇文章主要介绍了MySQL编程中的6个实用技巧,本文讲解了每一行命令都是用分号(;)作为结束、采用关联数组存取查询结果、TEXT、DATE、和SET数据类型等内容,需要的朋友可以参考下
收藏 0 赞 0 分享

mysql生成随机字符串函数分享

这篇文章主要介绍了mysql生成随机字符串函数分享,本文直接给出实现代码,需要的朋友可以参考下
收藏 0 赞 0 分享

Mysql大小写敏感的问题

这篇文章主要介绍了Mysql大小写敏感的问题的相关资料,需要的朋友可以参考下
收藏 0 赞 0 分享
查看更多