Why I can't log in MYSQL with phpmyadmin?

家住魔仙堡 提交于 2020-01-06 21:29:12

问题


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? P.S. Passwords are valid.


回答1:


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';



回答2:


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)



来源:https://stackoverflow.com/questions/36084886/why-i-cant-log-in-mysql-with-phpmyadmin

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!