mysql reset root password

Stop mysql services:

/etc/init.d/mysql stop

Start mysql in safe mode and skip user authentication:
mysqld_safe --skip-grant-tables &

Login to mysql as root, but you need use other console for this:
mysql -u root

Set a new password:
UPDATE mysql.user SET Password=PASSWORD('new_pass') WHERE User='root';

When you modify the grant tables manually you need to run:
flush privileges;

Restart the mysql services:
/etc/init.d/mysql start

Leave a Reply

Your email address will not be published. Required fields are marked *