无法登录MySQL服务器(XAMPP)

时间:2016-10-17 15:26:10

标签: mysql xampp mysql-error-1045

我遇到登录phpMyAdmin的问题,特别是当我使用root用户和正确的密码登录时,它给了我这个错误:

Cannot log in to the MySQL server

当我使用没有密码的'pma'用户登录时,它可以工作,但它没有我需要明显使用的权限。我很确定这是1045错误。

以下是config.inc.php中的设置:

/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'sutdenlol';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';

/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';

如果您需要更多信息,请告诉我而不是投票。

编辑: PHP脚本可以使用root用户使用正确的密码访问服务器。

1 个答案:

答案 0 :(得分:0)

Try to change

$cfg['Servers'][$i]['host'] = 'localhost';

to

$cfg['Servers'][$i]['host'] = '127.0.0.1';

and check do you have installed MySql Server on your machine. You can download it here - https://dev.mysql.com/downloads/