springboot报错discard long time none received connection. 的解决方法

 原错误如下:

 2022-10-07 20:13:20.839 ERROR 25784 --- [nio-2312-exec-6] c.a.druid.pool.DruidAbstractDataSource : discard long time none received connection. , jdbcUrl : jdbc:mysql://127.0.0.1:3306/reggie?serverTimezone=UTC&useSSL=false, jdbcUrl : jdbc:mysql://127.0.0.1:3306/reggie?serverTimezone=UTC&useSSL=false, lastPacketReceivedIdleMillis : 231524

解决方法: 

 在xxxAppliction类上加注解@ServletComponentScan

或者在xxxAppliction类加如下所示的静态代码块:

static { System.setProperty("druid.mysql.usePingMethod", "false"); }

你可能感兴趣的:(错误解决方法,spring,boot,java,后端)