Sunday, 9 February 2014

Reset Mysql Root password 


Recover a MySQL root password via the folowing steps :

Stop the MySQL server process :

/etc/init.d/mysql stop

Start again with no grant tables.

mysqld_safe --skip-grant-tables &

Login to MySQL as root.

mysql -u root
use mysql;

Set new password.

update user set password=PASSWORD("newrootpassword") where User='root';
flush privileges;
quit

Exit MySQL and restart MySQL server.

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

No comments:

Post a Comment