Pages

Friday 6 July 2012

Recover MySQL root Password

Recover MySQL root Password 

Do you lost or forgot mysql root password ? No problem…! You can recover MySQL database server password with following steps.

First Stop mysql service.

# /etc/init.d/mysqld stop

Start MySQL server without password:

# mysqld_safe – -skip-grant-tables &

Connect to mysql server using mysql client:

# mysql -u root

Setup new MySQL root user password

mysql> use mysql;
mysql> update user set password=PASSWORD(“NEW-PASSWORD”) where User=’root’;
mysql> flush privileges;
mysql> quit

Finally restart MySQL Server and test it.

# /etc/init.d/mysqld restart

# mysql -u root -p

No comments:

Post a Comment

Twitter Bird Gadget