本文共 602 字,大约阅读时间需要 2 分钟。
只需在mysql主从复制配置文件下加参数即可:
#编辑mysql配置文件(主库从库都需要修改)[root@mysql-db01 ~]# vim /etc/my.cnf#在[mysqld]标签下添加[mysqld]gtid_mode=ONlog_slave_updatesenforce_gtid_consistency#重启数据库[root@mysql-db01 ~]# /etc/init.d/mysqld restart#检查GTID状态mysql> show global variables like '%gtid%';+--------------------------+-------+| Variable_name | Value |+--------------------------+-------+| enforce_gtid_consistency | ON | #执行GTID一致| gtid_executed | || gtid_mode | ON | #开启GTID模块| gtid_owned | || gtid_purged | |+--------------------------+-------+转载于:https://blog.51cto.com/13523963/2349232