How To‎ > ‎

MySQL Password Recovery

If you, like me, somehow forgot your MySQL root password you can make use of this step-by-step guide how to reset it.
  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 the command

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

  5. Execute the command

    FLUSH PRIVILEGES;

  6. Use mysqladmin to shut down the MySQL daemon:

    mysqladmin shutdown

  7. Start MySQL server as per normal
Comments