MySQL: How do I reset MySQL to have only the databases when I first installed it? (CentOS, Redhat, Fedora, Linux)

One of my clients asked me today to make their MySQL installation go back to default database install. Basically they wanted me to get rid of all their databases (in this case test databases) so they can start fresh and go live with only the databases they needed. So here are the steps I followed.

Note: I have installed their MySQL from source and installed MySQL in to /usr/local/mysql folder. Your installation path might be different.

service mysql stop
cd /usr/local/mysql
mv var var.bak
mkdir var
chown -R mysql.mysql var
chmod 700 -R var
service mysql start

At this point we should have fresh MySQL db setup.

DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. Use at your own risk.

7 thoughts on “MySQL: How do I reset MySQL to have only the databases when I first installed it? (CentOS, Redhat, Fedora, Linux)

  1. Bruce

    It ‘called one of the best photo editing software.
    Rich in effects and customization with amazing lighting effects that allow you to make your photos beautiful masterpieces.
    Thousands of people satisfied, now for you is under discount.
    Take advantage of it, use IMAGIC PHOTO! info and buy–>

  2. Billie

    The Complete FroKnowsPhoto 6-Hour Guide to DSLR Video Now you can learn the fast track system used by a world class photographer and videographer to shoot, direct, and produce any type of video with a DSLR, regardless of your current skill level.

  3. jordan 1 off white

    I in addition to my friends have already been viewing the nice helpful hints from your web site and then before long I had a horrible suspicion I never expressed respect to the site owner for those secrets. Those boys appeared to be certainly passionate to see all of them and already have unquestionably been making the most of them. We appreciate you really being simply kind as well as for getting some awesome information most people are really desperate to be informed on. My sincere apologies for not saying thanks to you earlier.

Leave a Reply

Your email address will not be published. Required fields are marked *