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

sudo dpkg-reconfigure mysql_serverN.N

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

sudo dpkg-reconfigure mysql_server5.5


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.