Here is how to do it:
1. Shutdown MySQL using /etc/init.d/mysqld stop
2. Star MySQL using "--skip-grant-tables" parameter
/etc/init.d/mysqld-safe --skip-grant-tables
MySQL is now running in back round since we used (&) option
3. Now we can reset any password since MySQL is not validating permissions:
Login as root (you will not be prompted for the passoword) and reset MySQL root passwod:
mysql> update user set Password=PASSWORD('whoohoo') WHERE User='root';
Pretty cool huh, now you can restart MySQL as usual using "/etc/init.d/mysqld restart" and enjoy the changes.
No comments:
Post a Comment