MySQL Error Access Denied For Root User in Ubuntu Linux

preview_player
Показать описание
MySQL Error Code Access Denied for Root User localhost in Ubuntu Linux. Authentication will be by the system user credentials by Unix Auth Socket.

Steps to trouble shoot this issue.

It can be done in two ways.

OPTION 1 - to change the plugin of root user.
sudo mysql -u root -p
use mysql
update user set plugin="mysql_native_password" where User="root";
flush privileges;
exit;

OPTION 2 - Replace USER with the username you have.
1. sudo mysql -u root -p
2. use mysql;
4. create user 'username'@'localhost' identified by 'password';
5. grant all privileges on *.* to 'username'@'localhost';
6. update user set plugin = "auth_socket" where user='username';
7. flush privileges;
8. exit;
9. sudo service mysql restart

Рекомендации по теме
Комментарии
Автор

Plug-in auth socket not working, I have repupdated plugin with native password, it worked for me.

iammayurn
Автор

So helpful... I almost quit when it kept bringing those errors...thank you so much..

deusgitonga
Автор

you are amazing. and your voice is soo soothing. thanks a lot.

abhyaskanaujia
Автор

Thank you for this tutorial, this helped me a lot!

Azumichan
Автор

Use .... update user set where User="suraj";
And you are good to go. Nice video .... very clear and to the point. thanks.. keep it up.... "auth_socket" is meant for sudo login it self

amiaynarayan
Автор

Worked like a charm! Appreciate it! Thanks dude! Nonetheless I added my own little spice to it but hey! you just bagged one more subscriber to your channel.And again, really appreciate it :)

anupamsubba
Автор

Great, thank you for your support! It's work well.

ongphan
Автор

wow thank you it worked when i changed to mysql native passsword
i'm subscribing to your channnel

🤗🤗

Khayabushprojects
Автор

Hi, Suraj! I was wondering if you could give some advice in where I can find a handbook, page or any source of written information that helps to solve problems like this. I would like to delve into these issues but from a theoretical part. Thanks!

erickperezargueta
Автор

in step 6. update mysql.user set plugin = "auth_socket" where user='username'; and it worked for me, tks you so much

hoanghaiang
Автор

When you are creating user 'name'@'localhost' identified by 'password' what the value of "password" ?? Which password are we suppose To put there please?? I have been following your tutorial since and everything was going well up to this level
The reply "your password does not satisfy the current policy requirements" how am i suppose To do To resolve this Please

christaniameyoulemanga
Автор

Tanks a lot my friend! Regards from Brasil!

wandersonbarcelos
Автор

Simple and very helpful. Thanks a lot :)

daniellindemann
Автор

i just changed the plugin of 'root' to native password and that worked thank you so much

Medf
Автор

Hi, I followed all the steps, create new user with, set the privileges and for the host=localhost & plugin=auth_socket. But I am still not able to login into mysql database with sudo, on top of that, somehow, the password entering step is shown and required but I can enter with the incorrect password as well ( only null password is not allowed). Please help me out.

nitishkumar-zrzq
Автор

Whn u said one way is change the plugin of root to 'mysql_native_password' than why u changed the plugin for user suraj to auth_socket.

As after following ur steps i recived same error access denied. Unless i changed it back to mysql_native_password

ishitashakya
Автор

Muito bom, me ajudou em menos de um minuto de Vídeo kkkk thank you!

wellingtonsantos
Автор

after 'update user set where user='root'', still unable to login to the mysql CLI. How do I revert this query?

vision
Автор

Thank you very much. I was facing problem to connect webmin to mysql in VPS and access was denied. I solved this following your steps.

drpritimoy
Автор

thank you so much it was very helpful:)

mcxgqve