mysql - Mysql 连接错误

标签 mysql magento cross-domain database-connection

我正在使用 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/

相关文章:

mysql - 将祖鲁时间格式的日期时间插入mysql中的日期时间列

php - 如何使用 php 运行具有多个创建命令的 sql 文件,而无需手动解析 sql 文件?

php - Magento 'Select Configurable Attributes' 与 PHP

angularjs - 在 WKWebView 中托管的本地 AngularJS 应用程序

jquery - 如何在我的 Web 客户端上复制此 cookie 功能?

php - 存储过程返回 Mysql Php

php - 将默认值添加到 laravel 表单中的选择列表

flash - 攻击者如何绕过 crossdomain.xml

Magento: "Products Ordered"报告 - 如何显示可配置产品的子产品?

php - 如何加快Magento网站?