MySQL 分库备份脚本
时间:2021-07-01 10:21:17
帮助过:6人阅读
TIME=`date +%F_%H-%M-%S`
DIR=/backup
PASS=magedu
[ -d "$DIR" ] || mkdir $DIR
for db in `mysql -uroot -p "$PASS" -e ‘show databases‘ | grep -Ev
‘^(Database|information_schema|performance_schema)$‘`;do
mysqldump -F --single-transaction --master-data=2 -q -B $db | gzip > ${DIR}/${db}_${TIME}.sql.gz
done
MySQL 分库备份脚本
标签:pre nbsp col normal orm mys hit ase data