第十五周
1、编写脚本,支持让用户自主选择,使用mysqldump还是xtraback全量备份。 #!/bin/bash PS3="Please input a choice:" select menu in mysqldump xtrabackup; do case $REPLY in 1) mkdir /backup/dump/ &> /dev/null mysqldump -F -A --single-transaction --master-data=1 > /backup/dump/all.sql break ;; 2) mkdir /backup/test/ &> /dev/null xtrabackup --backup --target-dir=/backup/test/ &> /dev/null break ;; *) echo "please input again!" esac done 2、配置Mysql主从同步 环境:192.168.43.127 master 192.168.43.137 slave 1、master配置文件: [root@centos7 backup]#cat /etc/my.cnf [mysqld] **server-id=1** max_connections=2000 binlog_format=ROW **log-bin=/data