Skip to content

Instantly share code, notes, and snippets.

@peter-mcconnell
Created April 7, 2014 09:22
Show Gist options
  • Select an option

  • Save peter-mcconnell/10017193 to your computer and use it in GitHub Desktop.

Select an option

Save peter-mcconnell/10017193 to your computer and use it in GitHub Desktop.
Mysql - reset root password
1. Stop the MySQL Server.
`sudo /etc/init.d/mysql stop`
2. Start the mysqld configuration.
`sudo mysqld --skip-grant-tables &`
3. Login to MySQL as root.
`mysql -u root mysql`
4. Replace YOURNEWPASSWORD with your new password!
`UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root'; FLUSH PRIVILEGES; exit;`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment