Ubuntu – Reset thesql server root password?

MySQL

I do not care to gain access to any database data, I simply want to reset the root password for the MySQL server on an ubuntu 14.04 LTS vm that I am using for development and testing.

Several places I have read that dpkg-reconfigure will prompt for a new MySQL root password, but it does not. Nor does uninstalling and reinstalling mysql-server.

I tried uninstalling and zapping the configuration folder /etc/mysql, and that also had no effect.

It must have prompted me when I ran the installer and now I've forgotten what I entered.

Best Answer

Easiest method (as the Ubuntu Wiki suggests):

sudo dpkg-reconfigure mysql-server-N.N

replace N.N with the version of MySql.

Related Question