本文共 471 字,大约阅读时间需要 1 分钟。
MySQL版本用的是5.7,GTID指的是全局事务ID(global transaction identifier)。
在操作数据库时遇到了一个问题,具体错误提示为: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。这个错误的字面意思是违反了事务规则,但具体原因当时没有想到。经过参考网上意见,发现新建的MySQL数据库用的是MyISAM模式,这个模式是不支持事务的。为了解决这个问题,数据库模式被更改为InnoDB,InnoDB是提供事务支持的数据库引擎,同时还支持外键和行级锁等高级功能。
转载地址:http://iqdfk.baihongyu.com/