Tag: MySQL/Tips
show variables like '%char%';
mysql -uroot -p -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 -ppassword
mysql -uroot -pxxxxx -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);"}' > droppeddatabases.sql
mysql -e "show databases" | grep -Ev 'Database|^test$|mysql|_schema' | awk '{print "drop database "$1";"}' > dropdatabase.sql