Skip to content

Instantly share code, notes, and snippets.

@lorenzobr
Created July 3, 2013 15:14
Show Gist options
  • Save lorenzobr/5919176 to your computer and use it in GitHub Desktop.
Save lorenzobr/5919176 to your computer and use it in GitHub Desktop.
How to reset the MYSQL root password (UBUNTU 10)
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');
UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root';
FLUSH PRIVILEGES;
sudo /etc/init.d/mysql stop
sudo /etc/init.d/mysql start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment