LOST a MySQL Password? How to RESET it: VPS BIBLE




new password?
login
X

Reset a Lost MySQL Password

reset mysql database password image

So you’ve gone and locked yourself out of MySQL? Feels a bit like leaving the car keys in the trunk, huh? :D Sorry to laugh! But I can, ‘cos I’m gonna show you how to get back in.

It’s really not so tough. Using Super User permissions we’ll stop MySQL, start it again but skipping authority, change the password and restart as normal.

Here goes ..

Setup Unmanaged VPS: The Ubuntu-Nginx Guide

Take your virtual private server from zero to hero

  .. from blank box to cute-as server ..  

with this easy-to-follow copy/paste guide.

22+ parts with video, here’s the index.

Log into the terminal and, if you’re using Ubuntu, type:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

.. or, for other Linux distros:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

Now stop the MySQL daemon, typing:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

And kick it back up, but minus authentication:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

Hit return again for a new prompt.

NB AS far as I know, some older MySQL versions use safe_mysqld rather than mysql_safe, so try both.

Now you can connect to MySQL:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

.. and add a new password. The old one won’t be deleted.

Quit mysql:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

Restart the MySQL daemon with regular authentication (if you don’t, you leave your databases wide open to hacking), typing:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

And exit the root Super User account:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

.. and jump up and down a bit in a generally excited fashion.

Setup Unmanaged VPS: The Ubuntu-Nginx Guide

Take your virtual private server from zero to hero

with this easy-to-follow copy/paste guide.

“My local PC runs Windows” Show me for Linux

22+ parts with video, here’s the index ..

  • Appendix 1a: Nginx Control Panel

    You’re migrating shared-to-VPS and want a GUI like cPanel? No you don’t, not after you read this! What’s more, you don’t need one either.

  • Appendix 1b: Nginx Control Panel Workarounds

    For every control panel module there’s an equivalent terminal command. They’re all linked from here so, hey, no excuses!

  • Appendix 2: Add Web Sites Nginx Cheatsheet

    Once you’ve set up your first site, adding more gets easier. Especially when you can refer to this. (Let’s face it, I’m just too good to you.)




Got a Question? Want to Comment?

This site has no comments system. We've got a better system!

Please use the link at the top of the post and goto this topic's forum thread:-

  • to help build community
  • for a superior knowledge base
  • to keep info in one place, not diluted between forum & comments.

For those posts ported from Guvnr.com (pre-Feb/2010), archive comments remain.

Handy info from these comments is in the process of being ported to the forum and attributed to the original author.

If you think this idea sucks, let me know.

Thank you.

  • KarthikS September 2nd, 2009 at 4:05 pm

    Awesome posting. Sorted me out.

  • the_guv September 16th, 2009 at 5:51 pm

    @KarthikS .. good to hear, thank you.