Your Federal Quarterly Tax Payments are due April 15th Get Help Now >>

Reset Forgotten Mysql Root Password by cblastname


How to Reset Mysql Root Password

More Info
									Sometimes some person can forgetten their mysql root password.
It's a way to reset the root password on mysql, especially in linux:

1. Stop Mysql >>>      # /etc/rc.d/init.d/mysqld stop or
                       # Service mysqld stop or
                       # Kill mysql daemon with the command "pkill mysqld" or "kill -9 (mysql
                         pid number)"

2. Run MySQL in safe mode:
   # mysqld_safe --skip-grant-tables &

3. Login into Mysql without the root password:
   # mysql -u root mysql or
   # mysql -u root , then type use mysql at the prompt

4. Update Mysql password with the command:
   UPDATE user SET password = PASSWORD ("new password") WHERE user = "root";

5. exit

Stop mysqld-safe, such as how to stop mysql only change mysqld to mysqld-safe
Or u can use kill -9 like above
Then Start Mysql:
# service mysqld start or
# /etc/rc.d/init.d/mysqld start

Best Regards,

To top