PHP中的Mysql密码错误 [英] Mysql password Error in PHP

查看:40
本文介绍了PHP中的Mysql密码错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试从本地主机连接远程 mysql 服务器时出现此错误:

When i try to connect a remote mysql server from my localhost i get this error:

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

知道为什么会出现这个错误吗?

Any idea why it gives this error?

推荐答案

出现此错误是因为您的 MySQL 服务器使用了 old 存储密码的方式 -- 而不是 newem> 方式,更安全.

It gives this error because your MySQL server uses the old way of storing password -- and not the new way, which is more secure.

PHP 5.3 中引入的 mysqlnd 驱动程序不支持旧的身份验证方式.

The mysqlnd driver, which has been introduced with PHP 5.3, doesn't support the old authentication way.

因此,您必须修改 MySQL 配置,以使用新的、更安全的方式.
您收到的错误消息指示您如何执行此操作.

So, you have to modify your MySQL configuration, to use the new, more secure way.
The error message you get is indicating you how to do that.

这篇关于PHP中的Mysql密码错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆