【发布时间】:2011-08-12 16:25:08
【问题描述】:
我在从 PHP 5.3.5(WAMP 安装)连接到 MySQL 5.5.8 时遇到问题。我收到以下错误:
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
我已经尝试了所有可以在网络上找到的建议,包括来自 Stack Overflow 的一些建议和这个:http://engin.bzzzt.biz/2010/11/12/php-mysql-insecure-authentication/
我检查了我的设置并且旧密码标志已关闭。我已将密码更新为新密码哈希,并验证哈希在 users 表中是 41 个字符并刷新了权限。出于某种原因,我仍然收到错误消息。有人有什么想法吗?
更新:我正在使用 ZenCart。这是我正在建立连接和引发错误的行:
$this->link = @mysql_connect($zf_host, $zf_user, $zf_password, true) or die (mysql_error());
【问题讨论】:
-
显示您的连接代码。记得隐藏用户名/密码/主机名。
-
@Marc B - 不幸的是,我认为代码不会有太大帮助。我在继承项目的这个特定实例中使用 ZenCart。我已经用我正在建立连接的行更新了帖子。
-
@Marc B - 您建议的链接与我在原始问题中提到的相同。我已经尝试了那里的建议。
-
D'oh...我需要检查一下我的眼睛...