How to find out the MySQL root password

后端 未结 17 2466
野趣味
野趣味 2020-11-29 15:29

I cannot figure out my MySQL root password; how can I find this out? Is there any file where this password is stored?

I am following this link but I do not have dir

17条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-29 15:57

    In your "hostname".err file inside the data folder MySQL works on, try to look for a string that starts with:

    "A temporary password is generated for roor@localhost "

    you can use

    less /mysql/data/dir/hostname.err 
    

    then slash command followed by the string you wish to look for

    /"A temporary password"
    

    Then press n, to go to the Next result.

提交回复
热议问题