Monday, July 27, 2009

Reset Mysql Password in Linux


  1. Stop mysqld and restart it with the --skip-grant-tables --user=root options (Windows users omit the --user=root portion).

  2. Connect to the mysqld server with this command:
    shell> mysql -u root

  3. Issue the following statements in the mysql client:
    mysql> UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root';
    mysql> FLUSH PRIVILEGES;
    Replace “newpwd” with the actual root password that you want to use.


  4. You should be able to connect using the new password.

No comments:

Post a Comment