简体   繁体   中英

Why I can't log in MYSQL with phpmyadmin?

I have a problem. I can log in MYSQL by SHELL or Adminer (root or not-root user, whatever). But I can't with phpmyadmin. 'Cannot log in to the MySQL server'. What can be wrong? PS Passwords are valid.

First Step: check if port 3306 is open. If not then either you can open port 3306 by doing entry in iptables or simply you can stop this service (if not using any other purpose) by below command.

$ service iptables stop

Second Step: User should have permission to connect from your ip, if not then provide rights as per below-

> grant select,insert,update,delete on your_db.* to your_user@'your_ip' identified by 'your_password';

If this is not production server then initially you can provide globally full rights to check the problem by below command-

> grant all privileges on *.* to your_user@'%' identified by 'your_password';

The error " Cannot log in to the MySQL server " can have multiple causes. It simply means, that phpMyAdmin is not able to connect to the MySQL Server in general.

There are two causes I know:

  1. flawed settings in the Config.inc.php file (solution)

  2. the MySQL server rejects any queries, because the root password needs to be updated (solution)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM