h3x.no

Tor Henning Ueland`s thoughts about technology and other stuff

Archive for the ‘root’ tag

How to reset MySQL root password

without comments

To reset the MySQL root password, do the following:

USE DATABASE mysql;
SET PASSWORD FOR root@localhost=PASSWORD(‘yournewpassword’);
FLUSH PRIVILEGES;

And voila! You have changed your password.

PS: If you have a “problem” with beeing able to login to MySQL without using password (even when it is set in MySQL), try to edit or delete ~/my.cnf, since that holds information used to avoid the login promt.

Written by Tor Henning Ueland

July 22nd, 2009 at 11:15 pm

Posted in MySQL

Tagged with , ,