Skip to content

Instantly share code, notes, and snippets.

@40
Created March 27, 2012 17:41
Show Gist options
  • Save 40/2218283 to your computer and use it in GitHub Desktop.
Save 40/2218283 to your computer and use it in GitHub Desktop.
Super User ROOT MySQL Password DB Reset
Step # 1 : Stop mysql service
/etc/init.d/mysql stop
Step # 2: Start to MySQL server without password:
mysqld_safe --skip-grant-tables &
Step # 3: Connect to mysql server using mysql client:
mysql -u root
Step # 4: Setup new MySQL root user password
mysql> use mysql;
mysql> update user set password=PASSWORD("meh") where User='root';
mysql> flush privileges;
mysql> quit
Step # 5: Stop MySQL Server:
/etc/init.d/mysql stop
Step # 6: Start MySQL server and test it
/etc/init.d/mysql start
mysql -u root -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment