今天项目迁移,重新换了一个数据库版本,然后问题来了,原本运行正常的程序迁移过来之后就是不能正常运行,后台报错如下:

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 b.mvlikeId = ? and b.userId =a.user_id and b.userId != ? and b.isLIke = 1 and b.state = 0
### Cause: java.sql.SQLException: Statement violates GTID consistency: Updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tables.
; uncategorized SQLException for SQL []; SQL state [HY000]; error code [1785]; Statement violates GTID consistency: Updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tables.; nested exception is java.sql.SQLException: Statement violates GTID consistency: Updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tables.

网上查了一下 Statement violates GTID consistency这个,然后看到这个网页https://dev.mysql.com/doc/refman/5.6/en/replication-options-gtids.html,一开始还以为是数据库模式的问题,后面看了下数据库表,才知道原来是运维人员在新的数据库上把我的数据库表的模式设置成了MyISAM这个模式,然后去数据库show engines了一下,

可以看到,这个模式是不支持事物的,将它修改为InnoDB,问题搞定

事实上后面我又试了mysql5.7以上的版本,同样将引擎修改为MyISAM,执行操作,显示执行成功。到这儿我真的不知道究竟什么情况了,但确实是我让运维的同事将我的表的引擎修改为InnoDB就执行成功了。所以如果你也遇到同样的问题,不防检查一下表的引擎,修改一下试试

mysql Statement violates GTID consistency 的坑的更多相关文章

  1. MYSQL Statement violates GTID consistency: Updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as

    [2019-04-21 10:17:20] [ERROR] [org.hibernate.engine.jdbc.spi.SqlExceptionHelper:144] Statement viola ...

  2. MYSQL Statement violates GTID consistency: CREATE TABLE ... SELECT. 错误代码: 1786 问题

    1.在MYSQL中,执行建表语句时CREATE TABLE  aaaa  AS SELECT * FROM menu;  报: 错误代码: 1786Statement violates GTID co ...

  3. mysql错误:Statement violates GTID consistency

    在MYSQL中,执行建表语句时CREATE TABLE  aaaa  AS SELECT * FROM menu;  报: 错误代码: 1786Statement violates GTID cons ...

  4. 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') 错误 ...

  5. 备份数据库中的某个表的数据报错Statement violates GTID consistency

    1.错误描述 执行CREATE TABLE tig_pairs_20190521 AS SELECT *FROM tig_pairs报错: 1 queries executed, 0 success, ...

  6. MySQL5.7 GTID学习笔记,[MySQL 5.6] GTID实现、运维变化及存在的bug

      GTID(global transaction identifier)是对于一个已提交事务的全局唯一编号,前一部分是server_uuid,后面一部分是执行事务的唯一标志,通常是自增的. 下表整理 ...

  7. [MySQL 5.6] GTID实现、运维变化及存在的bug

    [MySQL 5.6] GTID实现.运维变化及存在的bug http://www.tuicool.com/articles/NjqQju 由于之前没太多深入关注gtid,这里给自己补补课,本文是我看 ...

  8. Repair MySQL 5.6 GTID replication by injecting empty transactions

    Since SQL_SLAVE_SKIP_COUNTER doesn’t work with GTID we need to find a way to ignore that transaction ...

  9. MySQL 5.6 GTID Replication【转】

    一. MySQL 5.6引入了GTID的概念,那么GTID是何方神圣?其实也不复杂,就是一个全局事务标示符.使用GTID时,每次事务提交都会在binlog里生成1个唯一的标示符,它由UUID和事务ID ...

随机推荐

  1. Android-monkey稳定性测试(多台设备同时进行)

                                       1.目的(原创文章,转载请注明出处-) 主要为指引开展android平台应用的稳定性测试,尽可能地在应用发布前发现crash及an ...

  2. gfw列表

    https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt

  3. (转)IC验证概述

    验证是确保设计和预定的设计期望一致的过程,设计期望通常是通过设计规范来定义的.对于芯片设计,在不同的阶段可以分为:寄存器传输级(RTL)的功能验证.门级的仿真验证.形式验证以及时序验证.我们通常所说的 ...

  4. bootstrap--小李子demo

    最近忙啊...看到各位冬鞋都在认真写博客,认真敲代码,认真工作,总觉得自己时间太少,总觉得时间不够,老了...... 进正题: 上次不知从哪里(忘了)下载了bootstrap的一些使用小demo,以后 ...

  5. 经典的Hello World VFP前端调后端C# Webservice

    1.按我设想的三层架构中,VFP是完全可以做为前端UI的,我们可以划分如下三层结构: 图片:三层架构图.jpg[设为封面] [删除] 其实大家看图,都明白大致意思,但是要明白各层数据是怎么流动的,却要 ...

  6. PO、VO、BO、DTO、POJO、DAO

    J2EE开发中大量的专业缩略语很是让人迷惑,尤其是跟一些高手讨论问题的时候,三分钟就被人家满口的专业术语喷晕了,PO VO BO DTO POJO DAO,一大堆的就来了(听过老罗对这种现象的批判的朋 ...

  7. 新年SO交期更新——FP_SO2SAP

    (一)         以下逻辑落在12月26日-2月4日生效,2月5日此段逻辑失效: (二)         针对SO创建日期落在N-1天的新单进行处理: (三)         根据FP运算逻辑: ...

  8. oricle数据库关于定时

  9. [知识整理]Java集合(一) - List

    一.实现List的几个类: ArrayList.LinkedList.CopyOnWriteArrayList.Vector 二.几个List底层的数据结构: ArrayList - 数组列表 Lin ...

  10. 初学c# -- 学习笔记(四)

    想想,数据库先用mysql了,这玩意小且安装方便.前面web学了些,现在学winform的.数据库先看看便捷的mysql. 下载了一个mysql5.7版的,装上居然找不到密码,重装3.4回,找不到,说 ...