Thursday, July 9, 2009

Resetting the Root MySQL Password

(Source: http://www.tech-faq.com/reset-mysql-password.shtml)

  1. Stop the mysqld daemon process.

  2. Start the mysqld daemon process with the --skip-grant-tables option.

  3. Start the mysql client with the -u root option.

  4. Execute: UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';

  5. Execute: FLUSH PRIVILEGES;



These steps reset the password for the "root" account to "password". To change the password for a different account, or to set a different password, just edit the variables in single-quotes in step 4.

If you know your existing MySQL root password, steps 1-3 are not necessary.

No comments:

Post a Comment