我正在使用 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
我的 MySql 数据库在另一个域中。我尝试从本地连接该数据库。
感谢您的回复
我更改了数据库密码。现在它通过了一个新的错误。
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.
最佳答案
您的 MySQL 服务器使用旧的身份验证机制,而 mysqlnd 无法遵守该机制。 mysqlnd 需要 MySQL 4.1 引入的新的 41 字节密码(因此您无法连接到低于 4.1 的 MySQL 服务器)。要更新您的用户表以使用新的密码方案,您必须在 MySQL 服务器上使用 SET PASSWORD 命令,例如:
为'root'@'localhost'设置密码 = PASSWORD('mypassword');
这会更改密码方案并允许您连接 mysqlnd。
关于mysql - Mysql 连接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8653065/