I just installed MySQL on Ubuntu and the root user can’t log in 🙂
How can I recover or find out my password? Using blank for password does not work.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can reset the root password by running the server with
--skip-grant-tablesand logging in without a password by running the following as root (or with sudo):Now you should be able to login as root with your new password.
It is also possible to find the query that reset the password in
/home/$USER/.mysql_historyor/root/.mysql_historyof the user who reset the password, but the above will always work.Note: prior to MySQL 5.7 the column was called
passwordinstead ofauthentication_string. Replace the line above with