Acest script care elimina toate bazele de date MySQL.
Eu folosesc acest script atunci când vreau să reconstruiesc serverul meu de replicare.
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
Ieșirea ar fi ceva de genul acesta:
[ root @ home ] # mysql - uroot - p - e "show databases" | grep - v Database | grep - v mysql | grep - v information_schema | grep - v bih002_bin_logs | grep - v test | grep - v OLD | gawk '{print "drop database " $1 ";select sleep(0.1);"}'
drop database callroom ; select sleep ( 0 . 1 );
drop database callroom_mgm ; select sleep ( 0 . 1 );
drop database dialogus ; select sleep ( 0 . 1 );
drop database limesurvey ; select sleep ( 0 . 1 );