“#2002 Cannot log in to the MySQL server” on login

2019-06-13 19:05发布

I am trying to setup drupal on windows 8 with XAMPP but when I try to login to phpmyadmin, I get this error: enter image description here

I've tried so many different things but I can't seem to get it working. Both Apache and MySQL are running fine from the XAMPP Control Panel.

3条回答
劫难
2楼-- · 2019-06-13 19:26

If you're on a fresh install, config.inc.php file may not exist. You need to rename/copy config.sample.inc.php file then change the relevant line.

please check below link:

phpMyAdmin is throwing a #2002 cannot log in to the mysql server phpmyadmin.

查看更多
太酷不给撩
3楼-- · 2019-06-13 19:27

This specific error can have multiple causes.

In your case I think the following settings might be wrong:

  • username
  • password
  • host
  • port

Just open the config.inc.php in your phpMyAdmin folder and double check the following lines:

$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['user'] = 'USER';
$cfg['Servers'][$i]['password'] = 'PASSWORD';

Another possible solution you might want to try, could be my answer to this question: enter link description here

查看更多
一纸荒年 Trace。
4楼-- · 2019-06-13 19:40

Your phpMyAdmin has been configured with an administrative user ('controluser') to access some advanced features of phpMyAdmin. However, it does not appear that user exists in MySQL. This suggests that XAMPP has had some glitch in installation, as I believe the XAMPP package normally configures this all for you.

The solution is rather easy; edit your config.inc.php and comment out a few lines by adding // to the beginning of each line. You should do that for the configuration directives for 'controluser', 'controlpass', and 'pmadb', then re-try.

Once you're connected, you can either decide to add the controluser manually or just leave things how they are and not have access to the more advanced features such as bookmarking queries, favorite tables, and so on.

查看更多
登录 后发表回答