Suppose you accidentally deleted MySQL’s root account or forgot what it is. In this case, this post explains how to recover MySQL root password by setting a new MySQL password.
Step 1. Stop the MySQL service then start with skip-grant-tables option, which allow anybody to login to MySQL without entering a password.
Step 2. Login Using MySQL Root User Without Entering Password
Step 3. Set MySQL Root Password To A New Password Using UPDATE Command
Step 4. Start MySQL Server and Login With The New Password
Have fun!