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
mv var var.bak
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.