Sunday, October 30, 2011

Mysql – Resetting root password

Once in a while you want to reset your mysql root password, here is how you can do it.

Stop the MySql service

    sudo /etc/init.d/mysql stop

Restart MySql in safe mode and skip grant table so that you can login with root without any password.

    sudo mysqld_safe --skip-grant-tables &

Login with root

    mysql -u root

Connect to MySql database

    use mysql;

Reset the password to a new password

    update user set password=PASSWORD("password") where User='root';

Read more: Hussain Anjarwala

Posted via email from Jasper-Net