mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication.

在阿里云ecs云服务器调用云主机的数据库时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加密模式是16位的hash,改为41位的就可以了

PHP5.3、5.4、5.5版本,加密模式设置为41位

 

posted on 2018-03-12 23:34  叶少翔  阅读(484)  评论(0编辑  收藏  举报

导航