SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost’ : Can’t log into phpMyAdmin
- Published on
- /2 mins read/---
This issue comes from some reason. But last time when i tried to setup ubuntu i see the problem happens frequently. So i can say most of the case from new linux OS install. Giving you two quick shot method.
Solution 1 :For PHPMyAdmin create a new Superuser
you can run mysql from your terminal with sudo like this below command.
Now add a new user with username you want to set. just chaneg the ‘dbuser’ and ‘dbpassword’ as your own choice.
Let grant this user as a super user/super privilege's
Hope you can login with new username & password you set.
Solution 2 : Authentication method changing for root
For login into phpmyadmin you have to switch auth_socket
to mysql_native_password
.
Open the terminal and run this commands below.
by run this command you can see your current plugin(auth_socket).
Now change this plugin with a new password. make sure you will change the password ‘dbpassword’ according to your own passwor.
nice ! lets flush privilege
Now exit the mysql terminal and try login. Hope it will works. If please restart mysql server. Besides you can comment if there any issues still you are facing.