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

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.

(0)

相关推荐

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

    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

  • mysql4.1以上版本连接时出现Client does not support authentication protocol问题解决办法

    mysql4.1以上版本连接时出现Client does not support authentication protocol问题解决办法 shell> mysql Client does not support authentication protocol requested by server; consider upgrading MySQL client 官方的说法是 MySQL 4.1 and up uses an authentication protocol based on 

  • window系统mysql无法输入和无法显示中文的解决方法

    第一步:使用记事本打开mysql安装目录下的"my.ini"文件. # MySQL client library initialization. [client] port=3306 [mysql] default-character-set=utf8 看看default-character-set 是不是 utf8不是的话 改为utf8即可!(以前的版本可能没有这句话 直接加上就好了!) 第二步:在mysql数据库cmd中输入:show variables like'%char%';

  • mysql本地登录无法使用端口号登录的解决方法

    最近在使用linux上进行本地登录时,发现既然无法正常登录 , 报如下错误信息: [root@xxxx ~]# mysql -h localhost -u root -p -P 3306 Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 分析:使用mysql --verbose --help进行分析,才发现原来port和socke

  • MySQL无法创建外键的原因及解决方法

    关联2张表时出现了无法创建外键的情况,从这个博客看到,问题出在第六点的Charset和Collate选项在表级和字段级上的一致性上.我的2张表的编码charset和collate不一致,2张表都执行执行SQL语句: alter table 表名 convert to character set utf8; 完美解决问题: ps:下面看下MySQL无法创建外键.查询外键的属性 MyISAM 和InnoDB 讲解 InnoDB和MyISAM是许多人在使用MySQL时最常用的两个表类型,这两个表类型各

  • MySql中表单输入数据出现中文乱码的解决方法

     MySQL会出现中文乱码的原因在于 1.server本身设定问题,一般来说是latin1 2.建库建表时没有制定编码格式. MySql中表单输入数据出现中文乱码的解决方法: 1.建库的时候 CREATE DATABASE test CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'; 2.建表的时候 CREATE TABLE content ( text VARCHAR(100) ) ENGINE=InnoDB DEFAULT CHARSET=utf8

  • MySQL修改my.cnf配置不生效的解决方法

    本文实例讲述了MySQL修改my.cnf配置不生效的解决方法.分享给大家供大家参考,具体如下: 一.问题: 修改了 my.cnf 配置文件后,却不生效,这是怎么回事? 二.原因: 我们注意到,这里只说了修改 my.cnf,并没有说清楚其绝对路径是哪个文件.也就是说,有可能修改的不是正确路径下的my.cnf文件. 在MySQL中,是允许存在多个 my.cnf 配置文件的,有的能对整个系统环境产生影响,例如:/etc/my.cnf.有的则只能影响个别用户,例如:~/.my.cnf. MySQL读取各

  • MySQL 出现错误1418 的原因分析及解决方法

    MySQL 出现错误1418 的原因分析及解决方法 具体错误: 使用mysql创建.调用存储过程,函数以及触发器的时候会有错误符号为1418错误. ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL,or READS SQL DATA in its declaration and binary logging is enabled(you *might* want to use the less safe log

  • MySql修改密码后phpMyAdmin无法登陆的解决方法

    安装wamp集成服务器并配置完成后,点击PhpMyAdmin,就可以进入mysql数据库在线客户端,但是当你修改了mysql管理员root用户密码后再点击将出现以下页面: 错误原因:这是因为修改了mysql密码后phpmyadmin配置文件没有同步更新 解决方法:打开config.inc.php(一般位于wamp/apps/phpmyadmin/下),修改数据库密码(我的数据库密码设置为root,所以此处也要同步),如下图所示 以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持

  • Ubuntu 18.04 安装MySQL时未提示输入密码的问题及解决方法

    Ubuntu 1804 安装MySQL 5.7为例给大家介绍的很详细. 执行命令安装MySQL sudo apt install mysql-server sudo apt install mysql-client 安装后看下是否启动: sudo ps aux | grep mysql 如果已经启动,执行完上述命令可看到相应的信息,如果没有启动,则可执行下面命令启动mysql: sudo service mysql start 另外,一会要用到重启mysql命令,重启和关闭mysql的命令分别是

随机推荐