0

当我尝试从 XAMPP 运行 phpMyAdmin 时出现此错误。在我安装和运行 XAMPP 之前,这台机器上有一个现有的 mysql 安装。当我启动 XAMPP 时,mysql 和 apache2 都成功启动。我可以使用 PHP 脚本访问 mysql 数据库,但不能通过 phpmyadmin。

Error

MySQL said: Documentation
#1045 - Access denied for user 'root'@'localhost' (using password: NO)
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.
4

2 回答 2

1

如果您想在没有密码的情况下以 root 身份访问 mysql,请/xampp/phpMyAdmin/config.inc.php确保在您的文件中设置以下变量:

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;
于 2010-10-04T19:58:08.977 回答
0

您是否为 root 用户设置了密码?您不应该通过 root 连接,但请检查一下。我还记得在不允许我以 root 用户登录的 phpmyadmin 版本之一中遇到问题。

于 2010-10-04T19:43:46.563 回答