Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    [MySQL] Reset root password or delete ALL databases

    There has been a recent problem with our server's DBAs and we lost control of the root password. The DBAs tables are safe as they can make backups with their own users, but the "root" user currently has an unknown password.

    Is there a way to edit a file like you can for UNIX passwords (in /etc/shadow) to reset the MySQL root password?

    Otherwise, is there a way to dump ALL tables, to be able to remove the MySQL package and then make a clean installation in which the DBAs can reimplement their backups?


  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    No need for such a drastic method.

    You can shut down mysql and then reset the root pw with:
    mysqld_safe --skip-grant-tables &
    mysql -u root
    use mysql
    update user set password=PASSWORD("NewPassword") where User='root';
    flush privileges;
    Then start your mysql daemoin again via init script.
    You must always face the curtain with a bow.

  3. #3
    Quote Originally Posted by Irithori View Post
    No need for such a drastic method.
    I guess I didn't need to do that, but we're actually going to migrate to MariaDB, and to avoid config file incompatibilities, I actually want to start from scratch. We're moving from MySQL 5.1 to MariaDB 10, so it's kind of a big bump.

  4. $spacer_open
  5. #4
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Either at home or at work or down the pub
    Maria DB 10 is only alpha software. As such it is indeed a brave person who installs it on a live box!
    Should you be sitting wondering,
    Which Batman is the best,
    There's only one true answer my friend,
    It's Adam Bloody West!

    The Fifth Continent

  6. #5
    Quote Originally Posted by elija View Post
    Maria DB 10 is only alpha software. As such it is indeed a brave person who installs it on a live box!
    I realized soon enough, so I kept MySQL, but thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts