您的网站程序调试完成并上传到云虚拟主机后,连接云虚拟主机数据库时,提示MySQL数据库版本错误。本文介绍这种情况的可能原因和解决方案。
问题现象
当您完成网站程序的调试并上传到云虚拟主机后,连接云虚拟主机数据库时,系统提示MySQL数据库版本错误。
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
可能原因
您在本地主机的测试环境中使用的MySQL版本为4.1,云虚拟主机提供的MySQL版本为5.1。您没有及时更换PHP版本和MySQL数据库的数据加密方式以匹配MySQL 5.1的运行要求。