我每行都有一个数据库名称的文件(database.txt):
database1
database2
.....
如何使用此文件:
$create database
$mysqldump
$drop database
create database from database.txt
$mysqldump database > database from database.txt
$drop database , from database.txt
由于
答案 0 :(得分:0)
您可以使用循环
while read -r db_name
do
create database ${db_name}
mysqldump ${db_name} [tbl_name ...]
drop database ${db_name}
done< "database.txt"