动态修改,使用下面命令 STOP SLAVE; SET GLOBAL master_info_repository = 'TABLE'; STOP SLAVE; SET GLOBAL relay_log_info_repository = 'TABLE';
mysql> show global variables like '%repositor%'; +---------------------------+-------+ | Variable_name | Value | +---------------------------+-------+ | master_info_repository | FILE | | relay_log_info_repository | FILE | +---------------------------+-------+ 2 rows in set (0.03 sec)
mysql> SET GLOBAL master_info_repository = 'TABLE'; Query OK, 0 rows affected (0.00 sec)
mysql> SET GLOBAL relay_log_info_repository = 'TABLE'; ERROR 1766 (HY000): Unknown error 1766
mysql> show global variables like '%repositor%'; +---------------------------+-------+ | Variable_name | Value | +---------------------------+-------+ | master_info_repository | TABLE | | relay_log_info_repository | TABLE | +---------------------------+-------+ 2 rows in set (0.01 sec)
将主库1和主库2上面的备份文件拷贝到从库上面,进行恢复 在从库上面操作 [root@MySQL03 mysql_software_57]# bin/mysql -uroot -p'root' -h 127.0.0.1 < /tmp/20171211_sale.sql mysql: [Warning] Using a password on the command line interface can be insecure. [root@MySQL03 mysql_software_57]# bin/mysql -uroot -p'root' -h 127.0.0.1 < /tmp/20171211_market.sql mysql: [Warning] Using a password on the command line interface can be insecure.