Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Today I realized that I forgot the MySQL password, or that somebody else changed it (I doubt it).

Is there any possibility that I can get the root password?

I have access to all the machine (as it's mine), don't think that I'm trying to hack into someone else database or w/e.

I'm desperate, I've trying with a lot of different passwords, no luck so far.

Thanks.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Restart MySQL with skip-grant-tables in your config, change the password, then restart again after taking skip-grant-tables back out.

Oh, and if you have an internet exposed MySQL listener (which you really shouldn't), then you need to change that (bind-address = 127.0.0.1) before you do this.

share|improve this answer
    
Thank you very much, it worked, you saved my life! –  user2077474 Nov 27 '13 at 3:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.