Mysql连接出错

San*_*raj 2 mysql database-connection cross-domain magento

我使用的是Magento ver-1.6.1.

当我尝试通过以下错误连接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
Run Code Online (Sandbox Code Playgroud)

我的MySql 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.
Run Code Online (Sandbox Code Playgroud)

Sud*_*oti 5

您的MySQL服务器使用mysqlnd无法遵守的旧身份验证机制.mysqlnd需要MySQL 4.1引入的新41字节密码(因此无法连接到MySQL服务器<4.1).要更新用户表以使用新密码方案,您必须在MySQL服务器上使用SET PASSWORD命令,例如:

设置密码为'root'@'localhost'= PASSWORD('mypassword');

这会更改密码方案,并允许您连接mysqlnd.