Tag: MySQL/Tips
show variables like '%char%';
mysqldump --single-transaction --default-character-set=binary --quick -uroot -p --all-databases | bzip2 > database.sql.bz2
bzcat database.sql.bz2 | mysql
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
mysqldump --single-transaction --default-character-set=binary --quick -uroot -p --all-databases | bzip2 > database.sql
[mysqld] innodb_file_per_table = 1