2011-12-28 142 views
2

我使用的Magento版本,1.6.1。错误MySQL连接

当我尝试通过下面的错误连接DB Magento。

SQLSTATE[HY000] [2000] 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 

My MySql DB在另一个域中。我尝试从本地连接该数据库。

感谢您的回复

我更改了DB密码。现在它通过一个新的错误。

SQLSTATE[HY000] [2002] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. 
+0

这是一个老版本的密码散列问题,所以作为错误消息指出,只是要求你的mysql管理员创建一个新密码或者只是使用'SET PASSWORD = PASSWORD('your_existing_password')'来改变旧的密码与新版本兼容。 – Vijay 2011-12-28 07:30:34

+0

我现在通过一个新的错误更改db密码:SQLSTATE [HY000] [2002]连接尝试失败,因为连接方在一段时间后没有正确响应,或者由于连接的主机未能响应而建立的连接失败 – 2011-12-28 08:53:44

回答

5

您的MySQL服务器使用了一种mysqlnd无法遵守的旧认证机制。 mysqlnd需要一个与MySQL 4.1中引入了新的41个字节的密码(所以你不能连接到MySQL服务器< 4.1)。要更新您的用户表使用你有你的MySQL服务器上使用set password命令新的密码方案,例如:

SET PASSWORD FOR“根” @“localhost”的= PASSWORD(“输入mypassword”);

这改变了密码方案,并允许你连接mysqlnd。

+0

现在它改变分贝密码通过一个新的错误:SQLSTATE [HY000] [2002]连接尝试失败,因为连接的方没有正确一段时间后响应或已建立的连接失败,因为连接的主机没有反应。 – 2011-12-28 08:53:17

+0

选中此链接,希望它有助于解决您的问题:http://tinsology.net/wiki/A_connection_attempt_failed_because_the_connected_pa​​rty_did_not_respond – 2011-12-28 09:11:33

4

尝试联系mysql主机管理。因为这不是magento问题,而是服务器的问题。