Reset MYSQL password


How to Reset a MySQL Password:

  1. Stop the mysqld daemon process,
  2. [root@host ~]# /etc/init.d/mysqld stop
    Stopping MySQL:               [  OK  ]
  3. Start the mysqld daemon process with the –skip-grant-tables option,
  4. [root@host ~]# /etc/init.d/mysqld start --skip-grant-tables
    Starting MySQL:                               [  OK  ]
  5. Start the mysql client with the -u root option,
  6. [root@host ~]# mysql -u root -p
    Enter password:

    <— enter current root password

  7. Change password to no password at all.  Execute the UPDATE mysql.user SET Password=PASSWORD(‘password’) WHERE User=’root’;
  8. mysql> UPDATE mysql.user SET Password=PASSWORD('') WHERE User='root';
  9. Execute the FLUSH PRIVILEGES;  command.
  10. mysql> FLUSH PRIVILEGES;

Found somewhere on the internet and helps me a lot.


Leave a Reply