1、在MYSQL中,执行建表语句时CREATE TABLE aaaa AS SELECT * FROM menu; 报:
错误代码: 1786
Statement violates GTID consistency: CREATE TABLE ... SELECT.
java后台报:
Caused by: java.sql.SQLException: Statement violates GTID consistency: CREATE TABLE ... SELECT.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3597)
解决:
在my.cnf 中将
gtid_mode = ON
enforce_gtid_consistency = ON
改为
gtid_mode = OFF
enforce_gtid_consistency = OFF
要两个参数一起改,然后重启mysql,问题解决