Last active
November 17, 2017 13:08
-
-
Save kartikm/7c25096681c47da302e2c07d7e09b7e9 to your computer and use it in GitHub Desktop.
How to reset MySQL/Mariadb root password
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo /etc/init.d/mysql stop | |
sudo mysqld_safe --skip-grant-tables --skip-networking & | |
mysql -u root | |
USE mysql; | |
UPDATE user SET password=PASSWORD("new_password") WHERE User='root'; | |
UPDATE user SET plugin="mysql_native_password"; | |
exit | |
sudo /etc/init.d/mysql stop | |
sudo kill -9 $(pgrep mysql) | |
sudo /etc/init.d/mysql start | |
You will be asked to autheticate using your system admin password. | |
Done! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment