Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 523 Bytes

resetting-mysql-root-password.md

File metadata and controls

21 lines (14 loc) · 523 Bytes

Resetting MySQL root password

Today I found myself locked out of MySQL because in the new server setup I managed to lose the password. Fortunately, there is a relatively straightforward way to reset it.

First, check the current version number of the MySQL being used.

apt-cache policy mysql-server

Then, type in the command below where *.* refers to version number.

sudo dpkg-reconfigure mysql-server-*.*

Voilà, now you can login with the new credentials!

mysql -u root -p