前言
MySQL版本:MySQL 8.0.15
数据库连接驱动版本:mysql-connector-java-8.0.15.jar
连接池版本:c3p0-0.9.5.2.jar
连接配置
#数据库驱动
jdbc.driver=com.mysql.cj.jdbc.Driver
#数据库连接
jdbc.url=jdbc:mysql://localhost:3306/miniss?characterEncoding=utf8&&serverTimezone=UTC&&autoReconnect=true
#用户名
jdbc.username=root
#用户密码
jdbc.password=123456
异常错误
Cause: com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 68,560,034 milliseconds ago. The last packet sent successfully to the server was 68,5
60,034 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the serv
er configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
; SQL []; The last packet successfully received from the server was 68,560,034 milliseconds ago. The last packet sent successfully to the server was 68,560,034 milliseconds ago. is longer than the server conf
igured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the
Connector/J connection property 'autoReconnect=true' to avoid this problem.; nested exception is com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was
68,560,034 milliseconds ago. The last packet sent successfully to the server was 68,560,034 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring
and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this p
roblem.
at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:98)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)
at com.sun.proxy.$Proxy19.selectOne(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:166)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
at com.sun.proxy.$Proxy20.adminLogin(Unknown Source)
at