MySQL - reset a lost MySQL root password
The MySQL root password allows full access to the MySQL database and allows for all actions to be undertaken including creating new users, new databases, setting access rules and so on.
The first thing to do is stop MySQL.
Now start mysql in safe mode.
Next we need to start MySQL in safe mode - that is to say, we will start MySQL but skip the user privileges table.
*ampersand (&) at the end of the command is required.
Login
Next, instruct MySQL which database to use:
Reset password
Enter the new password for the root user as follows:
and finally, flush the privileges and then stop and start mysql.
Leave a Reply
You must be logged in to post a comment.