Saturday, February 16, 2008

Resetting mysql passwd

Last method did not work. But this did


Alternatively, on any platform, you can set the new password
using the mysql client(but this approach
is less secure):



  1. Stop mysqld_safe 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;

No comments: