/etc/init.d/mysql stop
/etc/init.d/mysql start
mysql -uroot
mysql -uroot -e “show databases” | grep -v Database | grep -v mysql| grep -v information_schema| grep -v test | grep -v OLD |gawk ‘{print “drop database ” $1 “;select sleep(0.1);”}’ | mysql -uroot
/etc/init.d/mysql stop
rm ibdata1
rm ib_logfile*
rm -rf mysql
mysql_install_db
/usr/bin/mysqld_safe
/usr/bin/mysql_secure_installation
Enjoy