0

所以我在连接到我的 phpmyAdmin 服务器时遇到问题,但我通过编辑 PMA 文件夹中的 config.inc.php 文件并将我的用户名更改为 root 并将密码更改为 root 来解决它,所以现在看起来像这个:

$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'root';

这一切都很好,我的网站使用相同的凭据以类似的方式连接到数据库。问题是,我无法访问 PHPMyAdmin 界面中的“用户”选项卡——我在一个可爱的红色对话框中看到了这个错误:

MySQL said:
Cannot connect: invalid settings.
phpMyAdmin tried to connect to the MySQL server, and the server rejected the 
connection. You should check the host, username and password in your 
configuration and make sure that they correspond to the information given 
by the administrator of the MySQL server.

我知道这很荒谬,因为我可以完全访问所有数据库和设置,而且我的凭据是正确的。有谁知道这是为什么?

注意我在 Windows 环境中运行 XAMPP 3.1.0、Apache 2.4.7 和 MySQL 5.5.27。

4

1 回答 1

0

您是否为数据库创建了新用户?您应该避免使用 root 用户并为每个数据库创建一个新用户,而使用该用户。

于 2013-08-01T10:00:44.177 回答