Realize the sub-database backup of the MySQL database, realized by script.

vim db_backup

#!/bin/bash
db_name=`mysql -uroot -s -e "show databases;"` # -s 去掉数据库的边框
for i in $db_name
do
        echo $i > /root/shell/db/$i.sql
done

Guess you like

Origin blog.csdn.net/zhangthree1/article/details/109116229