Can’t log into phpMyAdmin
this is the common error when using linux with lamp setup
when trying to login phpMyAdmin with default credentials like
user name “root” and password with empty is shows like this
this error due to following reason:
Since MySQL 5.7+ you can no longer log into phpMyAdmin using the root account.
How we solve this when fresh install LAMP setup
Method 1 : Create new Superuser for phpMyadmin
In Terminal log into MySQL as root. you may have root password when install MySQL for the first time or the default password is blank. if you forget your password click here to reset password.
Now add new MySQL user with the username of your choice
now GRANT superuser privileges for your user
Now you able to access phpMyAdmin using new Account
Method 2: Change root Authentication Method
In order to log into phpMyAdmin as your root MySQL user, you will need to switch its authentication method from auth_socket
to mysql_native_password
.
Open MySQL prompt from your terminal:
Run Following Query
output will like this :
we can see that the plugin for the root account is set to auth_socket and need to change this to mysql_native_password run following query to change it
and flush privileges
Now yo may able to login your phpMyAdmin
Note : If you found a better solution then we can help each other out by sharing as many reference we can .
Thank you ! ❤