I found myself toying with one of my test servers the other nite and realized that I didn’t know what the root password was for my MySQL database.  After a quick bit of Google searching I found a very easy solution.  Granted this may be limited to recent releases of Ubuntu (tested on Ubuntu 7.10), but other solutions did not work for me.

Resetting the Password

To reset the MySQL root password on Ubuntu we can simply reconfigure the installed package, which prompts for the root user password setting at installation.

sudo dpkg-reconfigure mysql-server-5.0

This should display a dialog box asking for a new root user password.  Enter a new password and it’s reset.  Can’t be much simpler than that.

I post tutorials very regularly on this site. You may want to consider subscribing to the RSS feed. Or if you'd prefer these tips sent to your inbox you can use Email Subscriptions.

Related Posts

Random Posts

-->

Comments

5 Responses to “How To Reset the MySQL Password : Ubuntu 7.10”

  1. dave on January 8th, 2008 2:10 pm

    without reconfiguring check this simple command to change mysql root password
    http://www.ubuntugeek.com/reset-the-root-password-on-mysql.html

  2. Justin on January 9th, 2008 4:38 pm

    Or just use
    # mysqladmin password NEWPASSWORD

    As root

  3. dns on January 10th, 2008 3:14 am

    from the mysql docs
    http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html
    m
    ysqld_safe –skip-grant-tables -u root &

  4. joelmedia on February 19th, 2008 10:21 am

    Looks like the ‘reset-password’ function that a lot of other sites mention for this problem has been removed from the init.d script in ubuntu 7.10.

    Thanks, this is just what I needed. I can stop cutting myself now. :-)

  5. gnuskool on March 3rd, 2008 1:30 pm

    This works great, thumbs up geezer. I read heaps of different methods etc infinitum, yours worked straight away

Leave a Reply




    OSCON


    OSCON 2008

    Subscribe to the RSS feed!


    subscribe to the ubuntu tutorials RSS feed

    Polls


  • Regarding the Ads on Ubuntu Tutorials...

    • I dislike all web-based ads and use AdBlock (or similar) to destroy them! (49%, 155 Votes)
    • I don't mind the text-based ads on ubuntu-tutorials.com and currently view them. (31%, 99 Votes)
    • I would be willing to disable AdBlock (or similar) for this site considering I have found it helpful. (16%, 51 Votes)
    • I subscribe to ubuntu-tutorials.com via RSS or email so ads are a non-issue. (15%, 48 Votes)
    • I'd be willing to use the "Donate" button instead of see ads. (5%, 17 Votes)

    Total Voters: 316

    Loading ... Loading ...

  • Blogroll

  • Ads by Google