Skip to content

Instantly share code, notes, and snippets.

@korayguclu
Created November 13, 2013 00:00
Show Gist options
  • Save korayguclu/7441022 to your computer and use it in GitHub Desktop.
Save korayguclu/7441022 to your computer and use it in GitHub Desktop.
reseting mysql password
sudo /etc/init.d/mysql stop
sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &
mysql -u root
FLUSH PRIVILEGES;
SET PASSWORD FOR root@'localhost' = PASSWORD('password');
#If you have a mysql root account that can connect from everywhere, you should also do:
UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root';
sudo /etc/init.d/mysql start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment