当我尝试从我的本地主机连接远程 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/