PDA

View Full Version : my SQL help!



pmcarson
November 2nd, 2006, 07:35 PM
Hello all,

I am in a beginning Linux programming class, and was playing around with mySQL. My book told me to run the following commands

mysql> DELETE FROM mysql.user WHERE user != 'root';
mysql> DELETE FROM mysql.user WHERE host != 'localhost';

I was doing this assignment, but accidentally typed:

mysql> DELETE FROM mysql.user WHERE user != 'localhost';

and now I am unable to log in to mySQL. I don't know what happened, but I am very frustrated.

Any input you have would be much appreciated.

Thx in advance. ](*,)

yaaarrrgg
November 2nd, 2006, 10:10 PM
this might work (although I haven't tested it):

http://www.cyberciti.biz/tips/recover-mysql-root-password.html

pmcarson
November 3rd, 2006, 12:19 AM
Yay! it worked, thanks a bunch!

stashj
August 8th, 2007, 11:15 PM
Perfect! I was expecting this to be a nightmare. I managed to remove the create user priveleges from the root user (don't ask :-)) but with a small mod to this I managed to put them back.

Thanks for the link!