homehowtokbslinksaboutcontactprojectsmusic

Index > Help Tutorials > Reset MySQL Account

Reset root password for MySQL

Stop the mysql
sudo /etc/init.d/mysql stop
Set mysql to skip authentication step
sudo mysqld --skip-grant-tables &
Connect to mysql as root
mysql -u root mysql
Set new passwor
update user SET Password=PASSWORD('mypassword') WHERE User='root'; FLUSH PRIVILEGES; exit;
Replace mypassword with your new password

That is it !

Uninstall mysql completely

sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo deluser mysql
sudo rm -rf /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean