mysql 报错:MySQL 4.1+ using the

( ! ) Warning: mysql_connect() [function.mysql-connect]: mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in D:\work3\testphp\testsinykk.php on line

解决方法:

SET old_passwords = 0;
UPDATE mysql.user SET Password = PASSWORD('testpass') WHERE User = 'testuser' limit 1;
SELECT LENGTH(Password) FROM mysql.user WHERE User = 'testuser';
FLUSH PRIVILEGES;

如果要永久解决这个问题,修改my.cnf
vi /etc/my.cnf
old_passwords=1 将这个注释掉,重启mysql,再新建用户则无问题


本文固定链接: http://blog.wwllcchf.com/?p=188 | 吴文龙的个人博客

作者:wuwenlong 于2013年05月05日发表 & 关键词:
mysql 报错:MySQL 4.1+ using the | 吴文龙的个人博客

报歉!评论已关闭.