mysql错误:Statement violates GTID consistency

在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

 

posted @ 2018-01-23 21:47  浅雨凉  阅读(4134)  评论(1编辑  收藏  举报