Error Code: 1786 Statement violates GTID consistency: CREATE TABLE ... SELECT.

1、错误描述

1 queries executed, 0 success, 1 errors, 0 warnings

查询:call account_check_main(‘20180511‘)

错误代码: 1786
Statement violates GTID consistency: CREATE TABLE ... SELECT.

执行耗时 : 0 sec
传送时间 : 0 sec
总耗时 : 0.066 sec

2、错误原因

这是因为在5.6及以上的版本内,开启了 enforce_gtid_consistency=true 功能导致的,MySQL官方解释说当启用 enforce_gtid_consistency 功能的时候,MySQL只允许能够保障事务安全,并且能够被日志记录的SQL语句被执行,像create table … select 和 create temporarytable语句,以及同时更新事务表和非事务表的SQL语句或事务都不允许执行。

3、解决方法

方法一(推荐):

修改 :SET @@GLOBAL.ENFORCE_GTID_CONSISTENCY = off;

配置文件中 :ENFORCE_GTID_CONSISTENCY = off;

方法二:

create table xxx as select 的方式会拆分成两部分。

create table xxxx like data_mgr;
insert into xxxx select *from data_mgr;

原文地址:https://www.cnblogs.com/EikiXu/p/10026471.html

时间: 2024-10-11 12:01:55

Error Code: 1786 Statement violates GTID consistency: CREATE TABLE ... SELECT.的相关文章

mysql Statement violates GTID consistency 的坑

今天项目迁移,重新换了一个数据库版本,然后问题来了,原本运行正常的程序迁移过来之后就是不能正常运行,后台报错如下: update tbl_user_info set -- 强制下架 mv_count = mv_count-1, update_time=now() where user_id = ?; update tbl_user_info a,tbl_mv_like b set a.enjoy_num = a.enjoy_num -1, a.update_time = now() where

mysql - Error Code: 1093. You can't specify target table

UPDATE card SET value = (SELECT value FROM card WHERE id = 23) WHERE id = 20; 更新时 在where条件里面加入的子查询导致的. 解决方法: UPDATE card SET value = (SELECT val FROM (SELECT value as val FROM card WHERE id = 23)  as temp )WHERE id = 20;使用临时表. mysql - Error Code: 109

create table like 和create table select 比较

语法: CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name     [(create_definition,...)]     [table_options] [select_statement]   CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name     [(] LIKE old_tbl_name [)]; 测试过程: 原数据表: mysql> show create table test_or

MySQL主从复制中断,报“Error on master: message (format)='Cannot delete or update a parent row: a foreign key constraint fails' error code=1217” 错误

前几天,发现从库挂了,具体报错信息如下: 分析思路 1. 因为我采用的是选择性复制,只针对以下几个库进行复制: card,upay,deal,monitor,collect.所以,不太可能出现对于sas_basic的操作能复制到该从库上. 2. 整个架构是1主2从,且都是选择性复制,上面这个从库是直接复制card,upay,deal,monitor,collect这几个数据库的数据,而另外一个从库则是忽略上述库,如下所示: 怀疑是在上述schema下,执行了DROP TABLE IF EXIST

Error Code: 1360 - Trigger does not existQuery

1.错误描述 Query: DROP TRIGGER `t_sert_cs_approve` Error occured at:2015-04-12 13:37:32 Line no.:1 Error Code: 1360 - Trigger does not existQuery: ALTER TABLE `t_toot_erth_ssess` MODIFY COLUMN `id` int(20) NOT NULL AUTO_INCREMENT FIRST , ADD PRIMARY KEY

【SQL篇章--CREATE TABLE】

[SQL篇章][SQL语句梳理 :--基于MySQL5.6][已梳理:CREATE TABLE][会坚持完善] SQL : 1. Data Definition Statements: 1.3 CREATE TABLE 格式:3种建表语句 1.简单SQL表明结构: CREATE TABLE t7(id INT ,NAME VARCHAR(20), PRIMARY KEY(`id`)) ENGINE=INNODB; 格式: CREATE [TEMPORARY] TABLE [IF NOT EXIS

安装jmeter以后打开会弹出命令窗口提示:WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0 x80000002. Windows RegCreateKeyEx(...) returned error code 5.

安装jmeter以后打开会弹出命令窗口提示: WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0 x80000002. Windows RegCreateKeyEx(...) returned error code 5. 应该怎么解决: win+R输入regedit 打开REGEDIT.EXE(真恨微软和其regedit.reg). 然后找到HKEY_LOCAL_MACHINE \ SO

(转) WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.

今天要用Jmeter测试服务器性能,发现GUI界面总是有warning提示: 今天要用Jmeter测试服务器性能,发现GUI界面总是有warning提示: WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5. 在网上搜了搜,发现是Jmeter需要写注册表. 解决办法如下

解决hiveserver2报错:java.io.IOException: Job status not available - Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask

用户使用的sql: select count( distinct patient_id ) from argus.table_aa000612_641cd8ce_ceff_4ea0_9b27_0a3a743f0fe3; 下面做不同的测试: 1.beeline -u jdbc:hive2://0.0.0.0:10000 -e "select count( distinct patient_id ) from argus.table_aa000612_641cd8ce_ceff_4ea0_9b27_