I installed mysql-community-server-8.0.13-1.el7.x86_64
on Centos 7 with Nginx, and added the phpMyAdmin to manage the databases but I keep getting error Cannot log in to the MySQL server
from phpMyAdmin. I’ve tried the following and have been struggling for a few days now:
-
Changed some of the parameters (suggested on stackoverflow) located on
/etc/phpMyAdmin/config.inc.php
like the following but no luck:$cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['connect_type'] = 'socket'; $cfg['Servers'][$i]['socket'] = '/var/lib/mysql/mysql.sock'; $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = 'password';
-
I’ve tried mysql shell, and I’m able to login with
root
and other users. But, I have no idea why it fails on phpMyAdmin. Please help and thanks!
3
Answers
I was able to resolve this by doing the following: (I should mention that this solution works for MySQL 8.0.13 and phpMyAdmin 4.8.4 - Both, latest version today)
1- I edited
config.inc.php
with these server parameters (only):2- On MySQL terminal
This should allow you to login into phpMyAdmin. I hope this help!
This work for me :
On CentOS 7, I had to:
uncomment the "default-authentication-plugin=mysql_native_password" line in /etc/my.cnf
(then systemctl restart mysqld)
ALTER USER ‘user’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘your-password’;
A minor tweak on the accepted answer from Jacman above. I had tried everything else, but was missing the ‘WITH mysql_native_password’ clause