Find the answer to your Linux question:
Results 1 to 5 of 5
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! Pyrobisqit's Avatar
    Join Date
    May 2011
    Posts
    29

    [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?

    Thanks!

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,356
    No need for such a drastic method.

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

  3. #3
    Just Joined! Pyrobisqit's Avatar
    Join Date
    May 2011
    Posts
    29
    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. #4
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,487
    Maria DB 10 is only alpha software. As such it is indeed a brave person who installs it on a live box!
    What do we want?
    Time machines!

    When do we want 'em?
    Doesn't really matter does it!?


    Conkybots: Interactive plugins for your Conkys!

  5. #5
    Just Joined! Pyrobisqit's Avatar
    Join Date
    May 2011
    Posts
    29
    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
  •