当您完成网站程序的调试并上传到云虚拟主机后,连接云虚拟主机数据库时,系统提示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的运行要求。
更换云虚拟主机的PHP版本。
-
登录
云虚拟主机管理页面
。
-
找到报错的云虚拟主机,单击对应
操作
列的
管理
。
-
在左侧导航栏,选择
。
-
在
PHP版本设置
页面,将PHP版本设置为
PHP 5.3
,然后单击
保存设置
。
-
设置41位加密模式。
-
在左侧导航栏,单击
数据库信息
。
-
在
数据库信息
页面,单击
重置密码
。
-
在弹出的
数据库密码重置
对话框,将新密码设置为网站程序配置文件中的数据库密码,加密模式设置为41位,然后单击
确认
。
-
再次连接云虚拟主机数据库。