Skip to content
Discussion options

You must be logged in to vote

背景

涉及的MYSQL的参数:

  • tx_read_only (用于设置事务的只读模式)
  • tx_isolation (用于设置事务的隔离级别)

transaction_read_only与transaction_isolation参数在MYSQL5.7.20 版本引入,tx_read_only与tx_isolation参数在 MYSQL8.0 版本被移除。见MYSQL官网

报错原因

JDBC会根据获取DBLE版本信息fakeMysqlversion,决定是下发transaction_read_only还是tx_read_only。见JDBC源码

  • >=5.7.20的版本会下发 transaction_*参数
  • 其他版本会下发 tx_*参数

若下发的参数和后端MySQL不兼容时,会产生报错。

解决方式

在DBLE中的boostrap.cnf的fakeMysqlversion设置为>=5.7.20版本

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@yanhuqing666
Comment options

@wenyh1
Comment options

wenyh1 Jan 13, 2022
Collaborator Author

@yanhuqing666
Comment options

Answer selected by yanhuqing666
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants