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/...

Комментарии • 148

  • @iammayurn
    @iammayurn 5 лет назад +12

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

  • @deusgitonga5602
    @deusgitonga5602 4 года назад +2

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

  • @abhyaskanaujia3862
    @abhyaskanaujia3862 4 года назад +2

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

  • @amiaynarayan619
    @amiaynarayan619 4 года назад +3

    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

  • @Azumi0chan0
    @Azumi0chan0 4 года назад +2

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

  • @ongphan7347
    @ongphan7347 5 лет назад +1

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

  • @anupamsubba
    @anupamsubba 5 лет назад +1

    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 :)

    • @DevTechSolutions
      @DevTechSolutions  5 лет назад +1

      Thanks for your appreciation and valuable feedback :D

  • @wandersonbarcelos5519
    @wandersonbarcelos5519 5 лет назад +2

    Tanks a lot my friend! Regards from Brasil!

  • @erickperezargueta3047
    @erickperezargueta3047 2 года назад

    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!

  • @hoanghaiang8146
    @hoanghaiang8146 5 лет назад +1

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

  • @christaniameyoulemanga2157
    @christaniameyoulemanga2157 3 года назад +3

    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

  • @wellingtonsantos5292
    @wellingtonsantos5292 4 года назад +2

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

  • @khatarnak_rider_2.0
    @khatarnak_rider_2.0 3 года назад +1

    Thanks alot. Keep up the good work

  • @user-mc9xg2qv8e
    @user-mc9xg2qv8e 8 месяцев назад

    thank you so much it was very helpful:)

  • @athisii_ekhe6167
    @athisii_ekhe6167 4 года назад +3

    It worked for me. Thank you.

  • @Khayabushprojects
    @Khayabushprojects 4 года назад +2

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

  • @rousseld.nzoyem8105
    @rousseld.nzoyem8105 4 года назад +1

    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 ....

  • @nitishkumar-zr7zq
    @nitishkumar-zr7zq 3 года назад

    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.

  • @Gabriel-rf1gw
    @Gabriel-rf1gw 4 года назад +1

    Nice tutorial, thank you!

  • @vision2910
    @vision2910 4 года назад

    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?

  • @Khatvongviet1975
    @Khatvongviet1975 Год назад

    thanks so much, good job man

  • @daniellindemann8503
    @daniellindemann8503 3 года назад

    Simple and very helpful. Thanks a lot :)

  • @sathiyadev4322
    @sathiyadev4322 2 месяца назад +1

    i dont have mysql database like at 1:05 🤔what i supposed to do?

  • @Med7f
    @Med7f 4 года назад +2

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

    • @juliandjf
      @juliandjf 4 года назад

      how did you do that. please respond

    • @Med7f
      @Med7f 4 года назад +3

      @@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

    • @gokulbazz3910
      @gokulbazz3910 2 года назад +1

      @@Med7f thank a lot brother.!

  • @TheAlfin1
    @TheAlfin1 4 года назад +1

    Thank you suraj, it works on me!

  • @namrathanshetty309
    @namrathanshetty309 2 года назад

    Hi , in my case sudo mysql -u root -p is also showing access denied for user 'root@localhost' . How can I resolve that?

  • @antoniorodrigo897
    @antoniorodrigo897 5 лет назад +2

    super! thanks for helping us

  • @anirudhganwal06
    @anirudhganwal06 5 лет назад +1

    Thanks!! It worked for me..

  • @Cricdates
    @Cricdates 4 года назад +1

    Thank you so much for this video

  • @mariajosecastrogonzalez3145
    @mariajosecastrogonzalez3145 5 лет назад +1

    Super, graciaaas. Tenia 1 semana con ese error

  • @karthikpangala9854
    @karthikpangala9854 5 лет назад +1

    Thank you so much this works

  • @bhartendulal8645
    @bhartendulal8645 8 месяцев назад

    HI, I tried multiple time , create multiple user , but still have the same issue

  • @narendraverma825
    @narendraverma825 Год назад

    i have tried sudo mysql -u root -p and entered the system password but not working.. getting the same error

  • @ishitashakya7767
    @ishitashakya7767 3 года назад

    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

  • @drpritimoy
    @drpritimoy 3 года назад

    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.

  • @aldourtusuastegui7717
    @aldourtusuastegui7717 4 года назад +1

    i love it :) thanks

  • @sangameshwarmelkunde3240
    @sangameshwarmelkunde3240 4 года назад

    In termux app how to do this if access denied for root?

  • @theinva5741
    @theinva5741 4 года назад +2

    really helped me..thanks

  • @heartphung
    @heartphung 3 года назад +1

    thank you very much. it is very helpul for us

  • @Animemarkotaku
    @Animemarkotaku 4 года назад +3

    Where did you write the password? When I wanted to write my password in mysql, it answered me access denied.

    • @DevTechSolutions
      @DevTechSolutions  4 года назад

      Use the password which you have put while installing the mysql

  • @vampire-pd1ni
    @vampire-pd1ni Месяц назад

    Thanks a lot❤❤❤

  • @narendraverma825
    @narendraverma825 Год назад

    is this really working with the system password? it's not working for me

  • @sailebobadilla
    @sailebobadilla 5 лет назад +1

    Thanks a lot broh!

  • @bmmr
    @bmmr 5 лет назад +1

    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');

  • @mdalmamun7058
    @mdalmamun7058 4 года назад +1

    Thanks a lot brother

  • @sandhyajayasree1444
    @sandhyajayasree1444 5 лет назад +1

    Thank you.. So much....

  • @indianarmyanoop
    @indianarmyanoop 3 года назад +1

    Helpfull💕

  • @julioenriquegonzalezcrista742
    @julioenriquegonzalezcrista742 3 года назад

    un crack solucionaste mi problema :'0 gracias

  • @_AniketDive
    @_AniketDive 6 месяцев назад

    again getting error ---- ERROR 1698 (28000): Access denied for user 'aniket'@'localhost'

  • @susantakumarsahu5103
    @susantakumarsahu5103 5 лет назад +1

    tnnxxxxxx a lot bro

  • @renzofedeli
    @renzofedeli 3 года назад

    Me sirvio, gracias pibe!, pero ahora me salta otro error en el mysql workbench pero me voy acercando

  • @edwinguzman7872
    @edwinguzman7872 4 года назад +1

    Por algo como eso no me dejaba conectar dbeaver, gracias. Thank you.

  • @sidhikumari374
    @sidhikumari374 2 года назад +1

    I have the same laptop setup as him but this setting is not working from the first line and not help full for me 😣😣😣😣

    • @DevTechSolutions
      @DevTechSolutions  2 года назад

      Check the description and give me the screenshot of the error on the fb page/ gmail if the problem still persists

  • @varunsharma2507
    @varunsharma2507 3 года назад

    Thankyou so much!🙌🙇💫

  • @jessehenrique4343
    @jessehenrique4343 4 года назад

    When I type anything after having acces to mysql it just outputs:
    ->
    even when i write show databases it outputs
    ->
    i need helpppp

    • @DevTechSolutions
      @DevTechSolutions  4 года назад

      Use ; along with the command. If not, which command did you use.

  • @traafnduxng
    @traafnduxng 3 года назад

    Thanks u very much!

  • @shivanibutola7620
    @shivanibutola7620 3 года назад +1

    If I want the change for root user then what should I do?

    • @DevTechSolutions
      @DevTechSolutions  2 года назад

      just use sudo su and check the description for details

  • @abrincsaiju9842
    @abrincsaiju9842 3 года назад +2

    thanks it works

  • @kamelaouchiche6676
    @kamelaouchiche6676 3 года назад

    thank you, it worked for me when i updated:
    update user set plugin="caching_sha2_password" where User="suraj";

  • @nishtha7597
    @nishtha7597 4 года назад

    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

  • @anuruddhabandara2071
    @anuruddhabandara2071 3 года назад +1

    Thank you so much!!!

  • @joaquinbaeza4034
    @joaquinbaeza4034 4 года назад +1

    Thnks a lot !!!!! for the video.

  • @Brian-vz5et
    @Brian-vz5et 2 года назад +1

    Correction:
    mysql>update mysql.user set plugin="auth_socket" where User='your user name';

  • @prasadb8789
    @prasadb8789 5 лет назад

    its not working ,still its showing "ERROR 1698 (28000): Access denied for user 'kevin'@'localhost"

    • @DevTechSolutions
      @DevTechSolutions  5 лет назад +1

      try changing the plugin value with "mysql_native_password" rather than auth socket. In case it throws error please let me know again.

  • @dineshbaskaran01
    @dineshbaskaran01 3 года назад +1

    It's shows me 'you are not allowed to create a user with GRANT'

    • @DevTechSolutions
      @DevTechSolutions  2 года назад

      You need to have superuser privilege to use the command GRANT

  • @mohamedishan1150
    @mohamedishan1150 5 лет назад

    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 :)

  • @evansalvinkwasi221
    @evansalvinkwasi221 4 года назад +1

    thanks Sir

  • @FKTP796
    @FKTP796 3 года назад

    Thank u so much

  • @anandvmclt
    @anandvmclt 4 года назад

    Still Access Denied in my Case. How to resolve this issue ?

    • @DevTechSolutions
      @DevTechSolutions  4 года назад

      Try using 'mysql_native_password' instead of 'auth_socket'

  • @sujeetkumar.
    @sujeetkumar. 3 года назад

    Thank you.

  • @BrokenSnippet
    @BrokenSnippet 3 года назад

    it didn't work for me😪

  • @andromedia9649
    @andromedia9649 5 лет назад +1

    It did not work for me can you help me?

    • @DevTechSolutions
      @DevTechSolutions  4 года назад

      Try using 'mysql_native_password' instead of 'auth_socket'

  • @GabrielNunes-ch6ir
    @GabrielNunes-ch6ir 3 года назад

    thank you bro

  • @undefinedornull5687
    @undefinedornull5687 5 лет назад

    doesn't work for me ... mysql -u aaron -p then password and same error, Access denied for Aaron @ localhost

    • @DevTechSolutions
      @DevTechSolutions  5 лет назад

      Try changing the argument value to MySQL native password

    • @sourabhkadappa3274
      @sourabhkadappa3274 4 года назад

      How to do that bro?

    • @DevTechSolutions
      @DevTechSolutions  4 года назад

      @@sourabhkadappa3274 update user set plugin="mysql_native_password" where User=""; ( here username can be root or your system username )

  • @omareliotorrescastillo4808
    @omareliotorrescastillo4808 4 года назад

    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

    • @omareliotorrescastillo4808
      @omareliotorrescastillo4808 4 года назад +1

      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 :'(

    • @nishtha7597
      @nishtha7597 4 года назад +1

      @@omareliotorrescastillo4808 I am getting same error. Have you found any solution? then please share with me.

    • @omareliotorrescastillo4808
      @omareliotorrescastillo4808 4 года назад

      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

    • @omareliotorrescastillo4808
      @omareliotorrescastillo4808 4 года назад

      @@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

    • @omareliotorrescastillo4808
      @omareliotorrescastillo4808 4 года назад

      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

  • @LalatenduSwain
    @LalatenduSwain 3 года назад

    ERROR 1698 (28000): Access denied for user 'lala'@'localhost'

  • @mukeshsahani1323
    @mukeshsahani1323 5 лет назад +1

    Thanks

  • @memetete1251
    @memetete1251 4 года назад

    Thanks. But I cant connect it to workbench! Please help

    • @DevTechSolutions
      @DevTechSolutions  4 года назад

      Did you enter correct credentials, host and ip in workbench?

  • @andromedia9649
    @andromedia9649 5 лет назад +1

    Where do i get my system password?

    • @DevTechSolutions
      @DevTechSolutions  4 года назад

      Your system password would be password that you use to login

  • @looploop6612
    @looploop6612 4 года назад

    not working for me

  • @looploop6612
    @looploop6612 4 года назад

    ERROR 1524 (HY000): Plugin 'auth_socket' is not loaded

    • @DevTechSolutions
      @DevTechSolutions  4 года назад

      Try using 'mysql_native_password' instead of 'auth_socket'

  • @CaptainBullzAQW
    @CaptainBullzAQW Год назад

    all i need was a sudo command 💀 thanks man

  • @zidanesunesara8662
    @zidanesunesara8662 4 года назад

    Even using sudo I am getting same error

  • @ymadhu196
    @ymadhu196 Год назад

    what is password?

  • @ThuanTran-fo3fr
    @ThuanTran-fo3fr 3 года назад +2

    0:49 Please kindly talk to me about your password typing. Thanks.

    • @DevTechSolutions
      @DevTechSolutions  3 года назад +1

      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.

  • @jessehenrique4343
    @jessehenrique4343 4 года назад

    HOly shit it worked thanks

  • @MostaphaQamar
    @MostaphaQamar 3 года назад +1

    thanks

  • @sanjaykumarparida3663
    @sanjaykumarparida3663 3 года назад

    the problem still persists.

  • @nabinchand3852
    @nabinchand3852 3 года назад

    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?

    • @nabinchand3852
      @nabinchand3852 3 года назад

      Now my sql opens when I type anything as a password

  • @LalatenduSwain
    @LalatenduSwain 4 года назад

    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

  • @UnwrapTheExperience
    @UnwrapTheExperience 5 лет назад

    solution 1 is not working

  • @TheToyo212
    @TheToyo212 5 лет назад

    didnt work

    • @DevTechSolutions
      @DevTechSolutions  5 лет назад

      Could you please share your screenshot with me

    • @TheToyo212
      @TheToyo212 5 лет назад

      @@DevTechSolutions in the end it didnt allow me to join with my username. Did exactly as in video.

    • @DevTechSolutions
      @DevTechSolutions  5 лет назад

      If possible just share me the screenshot.

  • @skyline5555555
    @skyline5555555 4 года назад

    +++

  • @lindamarlyn6779
    @lindamarlyn6779 3 года назад +1

    0:32

  • @topikhidayat3697
    @topikhidayat3697 4 года назад +1

    Thanks!! It worked for me..

  • @da1kir
    @da1kir 3 года назад

    Thanks

  • @pythonista8487
    @pythonista8487 2 года назад

    Thank you so much. it worked for me.