Mysql数据库升级后,原有数据库密码无法访问

August 5, 2007 – 1:20 pm

 

提示错误:
Client does not support authentication protocol requested by server; consider upgrading MySQL client
原因:

出现这种问题也只有在MYSQL4.1.x以上版本
因为你使用的mysql服务器版本中使用了新的密码验证机制,这需要客户端的版本要在4.0以上,原来的密码函数被改为old_password();,这样使用password()生成的密码在旧的版本上的客户端就不好使了,而PHP中的MYSQL客户端都是3.23的(当然,mysqli的扩展除外)。

解决方法:重新设置mysql的数据库密码

# mysql -uroot -p1234567 (用户名:root,密码:1234567)

mysql>set password for ‘root’@’localhost’=old_password(’1234567′);

mysql>exit

#

Tags: , , , , ,

Post a Comment