Sometime back i wrote about resetting MySQL root password in Windows. I forgot my own password and hence had to crack it. I checked here but there was nothing for Linux. So to help up further, i’m writing this. And it’s pretty simple in Linux.
Before you proceed: You must have root access in your system.
1. Login to your system with root access
2. Stop running mysql service (mysqld stop)
3. Start mysql in safe mode without anypriviliges( mysqld_safe –skip-grant-tables & )
4. Now you can login to mysql root without password ( mysql -u root )
5. Now change the password of your root user ( update user set password=PASSWORD(‘newpassword’) where user=’root’
flush privileges )
6. Restart mysql service ( mysqld restart )
Voila you have changed your mysql root password to newpassword .