mysql 事务只读: Could not retrieve transation read-only status server
现场日志:
Resolved [org.springframework.jdbc.UncategorizedSQLException:
### Error updating database. Cause: java.sql.SQLException: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again
java.sql.SQLException: Could not retrieve transation read-only status server
解决过程:
1. 查看mysql的事物隔离级别 SHOW VARIABLES LIKE '%iso%';
返回结果: REPEATABLE-READ
把这个改成:READ-COMMITTED 就好了: SET GLOBAL tx_isolation='READ-COMMITTED';
(记得java重启应用,要永久生效的就改my.ini配置文件)
操作后无效
2. 将max_binlog_cache_size 原来的8M 调到512M 解决