First you need to stop mysql service:
/etc/init.d/mysqld stop
Now Start mysql in safemode:
mysqld_safe --skip-grant-tables
Login as root:
mysql --user=root mysql
Now run the below:
update user set Password=PASSWORD('new-password') where user='root';
flush privileges;
exit;
flush privileges;
exit;
Finally kill mysql process and start it again:
/etc/init.d/mysqld stop
/etc/init.d/mysqld start
Comments
Post a Comment