4

我正在尝试让一个站点在本地运行,该站点当前在运行 PHP 5.3.10 的开发服务器上运行。它连接到 5.5 版的 MySQL 服务器,但已old_passwords设置为ON.

该站点在开发服务器上运行。

在我的本地,我正在运行 PHP 5.3.26,当尝试连接时,我得到:

Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: 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

我知道这是 old_password 变量的问题,但它在 PHP 5.3 的开发服务器上运行。

编辑:这是我的本地 mysql 部分phpinfo()mysql php信息

开发服务器的 mysql 部分: mysql php信息

如何设置本地以匹配开发服务器?

4

1 回答 1

0

PHP 版本在这里不是问题,从 PHP 5.3 开始不再支持“旧”MySQL 密码。可能应用了两个不同的权限配置文件。你连接到同一台服务器吗?然后可能会发生这样的事情:

User       Host      
youruser   %           (using old-style password)
youruser   localhost   (using new-style password)

您使用相同的凭据并不一定意味着这些凭据指的是相同的帐户或权限配置文件。

于 2013-09-25T22:16:28.537 回答