php - PHP中Mysql密码错误

标签 php mysql xampp

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

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

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

最佳答案

出现此错误是因为您的 MySQL 服务器使用方式存储密码,而不是方式,后者更安​​全。

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

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

关于php - PHP中Mysql密码错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5687087/

相关文章:

php - 从 php 执行 shell 脚本在 Windows (Xampp) 上打开文件

wordpress - 链接重定向到仪表板 xampp

java - 我应该如何编写具有其他 Object 依赖项的 RowMapper?

Python mysql.connector 连接到特定目录 xampp 中的数据库

php - set_error_handler 带有来自自定义命名空间的回调

php - 唯一的我会基于ip +端口

PHP - MYSQL 到 ClientDataSet

mysql - 是否可以存储冗余数据以防外表记录被删除

php - Dompdf 远程图像未以 pdf 格式显示

php - 如何防止嵌套函数调用?