MySQL Error Access Denied For Root User in Ubuntu Linux
HTML-код
- Опубликовано: 24 ноя 2018
- 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
select user, host, plugin from mysql.user;
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;
3. select user, host, plugin from mysql.user;
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
Blog Post : www.devtechsolutions.in/2019/...
Plug-in auth socket not working, I have repupdated plugin with native password, it worked for me.
like me.
@@radiawad1569 I like you ;)
So helpful... I almost quit when it kept bringing those errors...thank you so much..
you are amazing. and your voice is soo soothing. thanks a lot.
Use .... update user set plugin="mysql_native_password" 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
Thank you for this tutorial, this helped me a lot!
Great, thank you for your support! It's work well.
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 :)
Thanks for your appreciation and valuable feedback :D
Tanks a lot my friend! Regards from Brasil!
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!
in step 6. update mysql.user set plugin = "auth_socket" where user='username'; and it worked for me, tks you so much
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
Muito bom, me ajudou em menos de um minuto de Vídeo kkkk thank you!
Thanks alot. Keep up the good work
thank you so much it was very helpful:)
It worked for me. Thank you.
wow thank you it worked when i changed to mysql native passsword
i'm subscribing to your channnel
🤗🤗
NICE, thanks Suraj.
Do not forget not just to use any name when creating a new user, user the first name that appears in "somename@somename" when you lunch the terminal ....
Roussel D. 2N. Yea jaja that user terminal
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.
Nice tutorial, thank you!
after 'update user set plugin='mysql_native_password' where user='root'', still unable to login to the mysql CLI. How do I revert this query?
thanks so much, good job man
Simple and very helpful. Thanks a lot :)
Glad it helped you, Keep supporting us :)
i dont have mysql database like at 1:05 🤔what i supposed to do?
i just changed the plugin of 'root' to native password and that worked thank you so much
how did you do that. please respond
@@juliandjf instead of creating a new user you do that :
update user set plugin="mysql_native_password" where User='root';
flush privileges;
it should work like that
@@Med7f thank a lot brother.!
Thank you suraj, it works on me!
Hi , in my case sudo mysql -u root -p is also showing access denied for user 'root@localhost' . How can I resolve that?
super! thanks for helping us
Thanks!! It worked for me..
Thank you so much for this video
Super, graciaaas. Tenia 1 semana con ese error
Thank you so much this works
HI, I tried multiple time , create multiple user , but still have the same issue
i have tried sudo mysql -u root -p and entered the system password but not working.. getting the same error
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
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.
Glad it helped you, Keep supporting us :)
i love it :) thanks
In termux app how to do this if access denied for root?
really helped me..thanks
thank you very much. it is very helpul for us
Where did you write the password? When I wanted to write my password in mysql, it answered me access denied.
Use the password which you have put while installing the mysql
Thanks a lot❤❤❤
is this really working with the system password? it's not working for me
Thanks a lot broh!
Thanks for the video, but just to mention mysqli error gives same error message , even if this string is having wrong credentials $mysqli = new mysqli('localhost', 'root', 'pwd', 'mydb');
Thanks a lot brother
Thank you.. So much....
Helpfull💕
un crack solucionaste mi problema :'0 gracias
again getting error ---- ERROR 1698 (28000): Access denied for user 'aniket'@'localhost'
tnnxxxxxx a lot bro
Me sirvio, gracias pibe!, pero ahora me salta otro error en el mysql workbench pero me voy acercando
Por algo como eso no me dejaba conectar dbeaver, gracias. Thank you.
I have the same laptop setup as him but this setting is not working from the first line and not help full for me 😣😣😣😣
Check the description and give me the screenshot of the error on the fb page/ gmail if the problem still persists
Thankyou so much!🙌🙇💫
Glad it helped you, Keep supporting us :)
When I type anything after having acces to mysql it just outputs:
->
even when i write show databases it outputs
->
i need helpppp
Use ; along with the command. If not, which command did you use.
Thanks u very much!
Glad it helped you, Keep supporting us :)
If I want the change for root user then what should I do?
just use sudo su and check the description for details
thanks it works
Glad it helped you 😀
thank you, it worked for me when i updated:
update user set plugin="caching_sha2_password" where User="suraj";
Glad it helped you, Keep supporting us :)
Its working in ternminal but when I go to localhost/phpmyadmin/ in browser then access is denied :( Am using username and password Why so? My error is:- mysqli_real_connect(): (HY000/1045): Access denied for user 'phpmyadmin'@'localhost' (using password: YES)
Connection for controluser as defined in your configuration failed.
mysqli_real_connect(): (HY000/1698): Access denied for user 'nishtha'@'localhost'
but in terminal mysql -u nishtha -p
Enter password:
Welcome to the MySQL monitor.
it is easily loggedin
Thank you so much!!!
Glad it helped you
Thnks a lot !!!!! for the video.
Glad it was helpful!
Correction:
mysql>update mysql.user set plugin="auth_socket" where User='your user name';
its not working ,still its showing "ERROR 1698 (28000): Access denied for user 'kevin'@'localhost"
try changing the plugin value with "mysql_native_password" rather than auth socket. In case it throws error please let me know again.
It's shows me 'you are not allowed to create a user with GRANT'
You need to have superuser privilege to use the command GRANT
It gives me this error ( ERROR 1054 (42S22): Unknown column 'User' in 'where clause' ), what is the meaning of this, and how can i fix it. The rest worked well, Thank you for great work :)
thanks Sir
Thank u so much
Glad it helped you, Keep supporting us :)
Still Access Denied in my Case. How to resolve this issue ?
Try using 'mysql_native_password' instead of 'auth_socket'
Thank you.
Glad it helped you, Keep supporting us :)
it didn't work for me😪
It did not work for me can you help me?
Try using 'mysql_native_password' instead of 'auth_socket'
thank you bro
Glad it helped you, Keep supporting us :)
doesn't work for me ... mysql -u aaron -p then password and same error, Access denied for Aaron @ localhost
Try changing the argument value to MySQL native password
How to do that bro?
@@sourabhkadappa3274 update user set plugin="mysql_native_password" where User=""; ( here username can be root or your system username )
i made exactly all the steps here, and when i try to get again to get in with the new user and password, i got ERROR 1698 (28000): Access denied for user 'elio'@'localhost', now i can not access to mysql with this new user
i used mysql_native_password instead of auth_socket and still the same problem, does not work, i can not access to mysql with the new user :'(
@@omareliotorrescastillo4808 I am getting same error. Have you found any solution? then please share with me.
Yes, i found the solution for this problem, now i am working with Mysql perfectly in ubuntu linux, the solution you have to create a new user with all the privilages in Mysql, see this video on how to do it ruclips.net/video/0MYLbHTCf7w/видео.html, if you dont give full privilages for the new user, you never will link Mysql database and your app, good luck
@@nishtha7597 i am working with Java, in order to make communication, i suggest you to use a basic java-mysql connection program and the mysql driver, so you can see if the connection is successful or not, good luck
i recommend you not to give full privileges to root, because if it fails you wont be able to get access to mysql prompt again, so make a new user with full privileges, greetings
ERROR 1698 (28000): Access denied for user 'lala'@'localhost'
Thanks
Thanks. But I cant connect it to workbench! Please help
Did you enter correct credentials, host and ip in workbench?
Where do i get my system password?
Your system password would be password that you use to login
not working for me
ERROR 1524 (HY000): Plugin 'auth_socket' is not loaded
Try using 'mysql_native_password' instead of 'auth_socket'
all i need was a sudo command 💀 thanks man
Even using sudo I am getting same error
what is password?
0:49 Please kindly talk to me about your password typing. Thanks.
You need to enter the password which you have used while mysql install else try sudo mysql -u (username) -p
Then enter password if you have set while installing else just type enter again to login into system.
HOly shit it worked thanks
thanks
Glad it helped you. Keep supporting us
the problem still persists.
which parameter have you modified?
Bro will you please explain about system password!
My pc showed an error when I tried to create a new user and used the sql password as system password
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
What should I put my system password?
UPDATE: Problem solved!!
Step 1- SHOW VARIABLES LIKE 'validate_password%';
Step 2- SET GLOBAL validate_password.policy=LOW;
Then I set my password to whatever I wanted. Is this right?
Now my sql opens when I type anything as a password
If not wok then try this
1. Stop mysql:
systemctl stop mysqld
2. Set the mySQL environment option
systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"
3. Start mysql usig the options you just set
systemctl start mysqld
4. Login as root
mysql -u root
5. Update the root user password with these mysql commands
mysql> UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPassword')
-> WHERE User = 'root' AND Host = 'localhost';
mysql> FLUSH PRIVILEGES;
mysql> quit
*** Edit ***
As mentioned my shokulei in the comments, for 5.7.6 and later, you should use
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
Or you'll get a warning
6. Stop mysql
systemctl stop mysqld
7. Unset the mySQL envitroment option so it starts normally next time
systemctl unset-environment MYSQLD_OPTS
8. Start mysql normally:
systemctl start mysqld
Try to login using your new password:
7. mysql -u root -p
solution 1 is not working
Try changing the argument
didnt work
Could you please share your screenshot with me
@@DevTechSolutions in the end it didnt allow me to join with my username. Did exactly as in video.
If possible just share me the screenshot.
+++
0:32
Thanks!! It worked for me..
Thanks
Glad it helped you, Keep supporting us :)
Thank you so much. it worked for me.
Glad it helped