Amitava Shee's Technical Diary

Monday, April 24, 2006

Reset mysql root password

The steps to reset mysql root password

  1. Stop mysqld service - In fedora this can be done as "sudo /sbin/service mysqld stop"
  2. Start mysqld with skip-grant-table option - "sudo /usr/bin/mysqld_safe --skip-grant-table &"
  3. Fire up mysql client as "mysql -u root mysql"
  4. Reset password - mysql> update user set password=password("secret") where user="root";
  5. Flush privileges - mysql>flush privileges;
  6. Shutdown mysqld - mysqladmin -u root -p shutdown. Please note that this will prompt for the newly created password

0 Comments:

Post a Comment

<< Home