云虚拟主机使用PHP安装Discuz论坛创建数据库时,提示以下报错。
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
具体报错信息以下图所示。
问题原因
出于安全考虑PHP5.3版本之后连接MySQL统一使用41位加密方式,如果在主机管理控制台中修改PHP的版本(例如,5.2修改为5.3),连接数据库会提示以上报错。
解决方案
若PHP版本为5.3请修改为5.2,依次选择高级环境设置>PHP版本设置,选择PHP5.2版本,单击保存设置即可。