mysql重连,连接丢失:The last packet successfully received from the server

解决方案

数据库连接设置:autoReconnect = true

url=jdbc:mysql://xxx.xxx.xxx.xxx:3306/xxx?characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&pinGlobalTxToPhysicalConnection=true

配置设置:

spring.datasource.druid.testOnBorrow=true

spring.jta.atomikos.datasource.test-query=SELECT 1

spring.jta.atomikos.datasource.borrow-connection-timeout=60

 

你可能感兴趣的:(java)