OpenSUSE Linux Rants

OpenSUSE Linux Tips, tricks, how-tos, opinions, and news

My Resume  -  My LinkedIn Profile - twitter: @scottmmorris

June 11, 2009

Reset MySQL root Password in Linux

by @ 9:36 pm. Filed under Linux tips

Stolen From Here

Reset Forgotten MySQL Root Password

Have you ever forgotten the root password on one of your MySQL servers? No? Well maybe I’m not as perfect as you. This is a quick h00tow (how to) reset your MySQL root password. It does require root access on your server. If you have forgotten that password wait for another article. Original article posted on reset mysql root password.

First things first. Log in as root and stop the mysql daemon. Now lets start up the mysql daemon and skip the grant tables which store the passwords.

mysqld_safe –skip-grant-tables

You should see mysqld start up successfully. If not, well you have bigger issues. Now you should be able to connect to mysql without a password.

mysql –user=root mysql

update user set Password=PASSWORD(’new-password’) where user=’root’;
flush privileges;
exit;

Now kill your running mysqld, then restart it normally. You should be good to go. Try not to forget your password again.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Reddit
  • StumbleUpon
  • Technorati
  • Diigo
  • email
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Mixx
  • MySpace
  • Twitter
  • Yahoo! Buzz
If you enjoyed this post, make sure you subscribe to my RSS feed!

3 Responses to “Reset MySQL root Password in Linux”

  1. Viktor Says:

    Thanks for this! Always handy to know.

  2. wagg.it Says:

    OpenSUSE Linux Rants…

    OpenSUSE Linux Rants provides tips, tricks, articles, news, opinions, tutorials, and howtos regarding opensuse and suse linux….

  3. socialwebcms.com Says:

    OpenSUSE Linux Rants…

    OpenSUSE Linux Rants provides tips, tricks, articles, news, opinions, tutorials, and howtos regarding opensuse and suse linux….

Leave a Reply

OpenSUSE Linux Rants
Official OpenSUSE Linux Site

internal links:

categories:

SUSE Resources

search blog:

rss feeds

news & syndication

archives:

December 2009
S M T W T F S
« Nov    
 12345
6789101112
13141516171819
20212223242526
2728293031  

latest tweets:

  • I just got some music project material from one of my very favorite musicians. Dorshan, you rock, sunshine. :) 20 hrs ago
  • Kids just put 2 boxes of cocoa into the toilet. Why... ?! How does a kid come up with, "Gee, I think it would be a great thing to..." WTF? 1 day ago
  • Nightwish and Within Temptation pwn!!11! Unless I need Testament. :) 1 week ago
  • Bruce, dude.... see if you can take this: http://bit.ly/xph5t 2 weeks ago
  • Mwahahah... PBX in a Flash + Google Voice now able to place inbound and outbound calls sans weirdness. A free landline. Woot! 2 weeks ago
  • If anyone has a male Rose Hair tarantula, let me know. I want to breed my female. They have 300 babies at once. That's brave. 2 weeks ago
  • More updates...

51 queries. 0.616 seconds