Skip to content

Instantly share code, notes, and snippets.

@alxsimo
Created February 7, 2015 18:41
Show Gist options
  • Save alxsimo/abd0114c1e97fe5c3ce2 to your computer and use it in GitHub Desktop.
Save alxsimo/abd0114c1e97fe5c3ce2 to your computer and use it in GitHub Desktop.
[MySQL] Reset MySQL root password
For Ubuntu Server
1. Set root password
sudo su
passwd
2. sudo /etc/init.d/mysql stop
3. sudo /etc/init.d/mysql start --skip-grant-tables
4. mysql
5. UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
6. mysql -u root -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment