How to Reset Mysql ROOT Password

1) Stop the mysql demon

/etc/init.d/mysql stop

2) Start the mysqld demon process using the –skip-grant-tables option with this command

/usr/sbin/mysqld –skip-grant-tables –skip-networking &

3) start the mysql client process using this command

mysql -u root

4) from the mysql prompt execute this command to be able to change any password

FLUSH PRIVILEGES;

5) Then reset/update your password

SET PASSWORD FOR root@’localhost’ = PASSWORD(‘password’);

FLUSH PRIVILEGES;

6) Then stop the mysqld process and relaunch it with the classical way:

/etc/init.d/mysql stop
/etc/init.d/mysql start

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s