Pages

Monday, July 16, 2012

Reset the MySQL root password


To reset MySql root password on Ubuntu, you can use following commands.

1. Stop MySql Service on server

sudo /etc/init.d/mysql stop
2. Now configure mysqld

sudo mysqld –skip-grant-tables &
3. Login into MySql as root

mysql -u root mysql
4. Reset old password with new

UPDATE user SET Password=PASSWORD(‘NewPassword’) WHERE User=’root’; FLUSH PRIVILEGES; exit;
Note :: Replace NewPassword with required mysql root password.

No comments:

Post a Comment