实现对MySQL数据库进行分库备份,用脚本实现。

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

猜你喜欢

转载自blog.csdn.net/zhangthree1/article/details/109116229