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.
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:
flawed settings in the Config.inc.php file (solution)
the MySQL server rejects any queries, because the root password needs to be updated (solution)
$cfg['Servers']
, and post them here? Be careful to remove any passwords. It's likely that your web server is not accessing the mysql server the same way as your shell/adminer instance (socket vs tcp, localhost vs remote). If it is local vs remote, ensure your mysql server is listening on non-local IPs, and that your users have permissions on remote IPs. – QuickDanger Mar 18 '16 at 16:34STATUS;
command and note the user, host, and connection type. Then compare those to the error message provided by MySQL. This could be a host name mismatch or trying to connect via socket instead of tcp/ip (or vice-versa). – Isaac Bennetch Mar 22 '16 at 0:05