'Access denied for user 'root'@'localhost' (using password: NO)'

后端 未结 8 1315
夕颜
夕颜 2020-11-29 21:28

I\'m trying to set the password of the user root but I\'m gettin the error below, any idea?

+----------------------------------------------------------------         


        
8条回答
  •  感动是毒
    2020-11-29 22:15

    Those are all good answers, but don't quite touch the deep cause of the problem one most likely has if faced with the OP question. That is, not knowing the ORIGINAL "starting" password created during the installation time.

    And all these command lines with "-u root ..." etc. imply knowing and using THAT password.

    Now this part from the original installation message may help anyone facing the problem above:

    Initial password for first time use of MySQL is saved in $HOME/.mysql_secret
    ie. when you want to use "mysql -u root -p" first you should see password
    in /root/.mysql_secret

提交回复
热议问题