解决mysql 允许执行 XA RECOVER语句(atomikos 解决分布式事务报错)
2020-07-30 16:05:25.908 INFO 12880 --- [nio-8080-exec-1] c.a.d.xa.XATransactionalResource : db1: refreshed XAResource
2020-07-30 16:05:25.970 WARN 12880 --- [nio-8080-exec-1] c.a.r.xa.XaResourceRecoveryManager : Error while retrieving xids from resource - will retry later...
com.mysql.cj.jdbc.MysqlXAException: XAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistency
at com.mysql.cj.jdbc.MysqlXAConnection.mapXAExceptionFromSQLException(MysqlXAConnection.java:333) ~[mysql-connector-java-8.0.11.jar:8.0.11]
当前访问mysql的账号root缺少系统权限,执行以下sql语句即可
GRANT XA_RECOVER_ADMIN ON *.* TO root@'%' ;
查看mysql当前访问用户的权限
show grants for 用户名@'主机地址(%代表任意ip)'
参考:https://blog.csdn.net/qq_43028054/article/details/93138503