云虚拟主机连接MySQL数据库失败的解决方法
网站编辑2021-06-29 13:50:28318
完成网站程序的调试并上传到云虚拟主机后,连接云虚拟主机数据库时,系统提示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的运行要求。
1.更换云虚拟主机的PHP版本。
登录云虚拟主机管理页面。
找到报错的云虚拟主机,单击对应操作列的管理。
在左侧导航栏,选择高级环境 > PHP版本设置。
在PHP版本设置页面,将PHP版本设置为PHP 5.3,然后单击保存设置。
2.设置41位加密模式。
在左侧导航栏,单击数据库信息。
在数据库信息页面,单击重置密码。
在弹出的数据库密码重置对话框,将新密码设置为网站程序配置文件中的数据库密码,加密模式设置为41位,然后单击确认。
3.再次连接云虚拟主机数据库







