cannot+connect+mysql_虚拟主机PHP程序提示“mysqlnd cannot connect to MySQL 4.1+ using the old insecure“错误的原因和解...

虚拟主机PHP程序在安装如Discuz等程序时在数据库安装步骤中出现“mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. ”错误,如下图:

d6b6d706c3e13186d17f581621a4a5f8.png

该问题原因是出于安全考虑PHP5.3版本之后连接MySQL都统一使用41位加密方式,如果在虚机控制面板cp.hichina.com修改PHP版本,比如5.2改成5.3,而并没有修改数据库加密方式,仍然使用16位加密方式,连接数据库就会报如下错误:

Could not connect: 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。

该问题可以尝试通过以下步骤解决:

登陆cp.hichina.com【主机管理控制台】->【数据库管理】,重置数据库密码,加密模式选择41位加密。同理如果是PHP5.3改成5.2版本,就修改数据库密码加密模式从41位改成16位。

193687e0b96eecf53af56cf1acc2dba3.png

温馨提示:通过控制面板修改数据库密码后必须将程序配置文件中的数据库密码修改为新的密码,如果不确定数据库配置文件如何修改,请谨慎操作,建议联系程序开发商咨询确认后再进行处理。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值