Last active
August 18, 2016 08:17
-
-
Save sumanthkumarc/def6bbf6a9cc0ca034f25d2ef311f683 to your computer and use it in GitHub Desktop.
resetting a mysql root pass(Assuming Ubuntu and new mysql version)
This file contains hidden or 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
# Stop running myslq server | |
sudo /etc/init.d/mysql stop | |
#Restart mysql server in safe mode with no grant table(no security) | |
sudo mysqld_safe --skip-grant-tables & | |
#Login to muysql as root | |
mysql -uroot | |
#Change to mysql database | |
use mysql; | |
#Change user password for root | |
update user set authentication_string=PASSWORD('mynewpassword') where user='root'; | |
#Flush provileges and then quit | |
flush privileges; | |
quit; | |
#Restart the mysql server | |
sudo /etc/init.d/mysql start | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment