mysql批量导出脚本
#!/bin/bash i=`mysql -uroot -h 127.0.0.1 -ptest111000 -e 'show databases;'|grep -E -v "Database|information_schema|mysql|performance_schema"` for k in $i do mysqldump -uroot -h 127.0.0.1 -ptest111000 $k >> db.$k.sql done
mysql批量导入脚本
#!/bin/bash i=`cat db.txt` for k in $i do mysql -uroot -h 127.0.0.1 -ptest111000 -e "create database $k;" mysql -u root -h 127.0.0.1 -ptest111000 $k < db.$k.sql done