导出数据:
${MYSQLDUMP} -h${BACKUP_HOST} -u${BACKUP_USER} -p${BACKUP_PASSWD} -R -E --single-transaction --master-data --set-gtid-purged=off --databases ${BACKUP_DATABASE} > ${backupfile}
导入数据:
mysql -u ${USER} -p ${DATABASE} < ${SQL}
mysql导入数据报错:
ERROR 1794 (HY000) at line 22: Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MySQL error log.
因为只是导入数据,且是本地库,不涉及主从,此时只需删除脚本中的主从配置信息即可
CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.001879', MASTER_LOG_POS=5941631;