Reset MySQL Root Password on Ubuntu/Debian

Forgetting the password is a nightmare everyone has gone through. Especially if they are crucial ones like MySQL root user password. Fortunately, it’s very simple to reset it back.

Just enter the following command at your terminal

where N.N is MySQL version you are using. For example, if you are using MySQL 5.5, then the command becomes