This is a quicker, less intrusive method with less downtime to reset mysql root password: Create the following file and then enter the command that follows
1 |
vim /var/lib/mysql/mysql .init |
1 |
SET PASSWORD FOR 'root' @ 'localhost' =PASSWORD( 'mynewpassword' ); |
1 |
init_file= /var/lib/mysql/mysql .init |
1 |
service mysqld restart |
1 |
mysql -u root -p |