SQLSTATE[HY000] [2000] 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.
初学Laravel4常见的问题之二:这个问题是我在本地运行Laravel连远程Mysql服务器出现的。
一翻百度之后,发现遇到相同问题的还真不少,不过大多数写的比较复杂,其中一些还没有作用。
综合网上的方案之后,我总结了以下三步操作:
感谢:http://www.iteye.com/problems/87928
- 连接mysql(用root登陆),设置old_passwords = 0
mysql> SET old_passwords = 0;
- 改密码
mysql> UPDATE mysql.user SET Password = PASSWORD('USER_PASSWORD') WHERE User = 'USER';
- 更新权限
mysql>FLUSH PRIVILEGES;