为了账号安全,请及时绑定邮箱和手机立即绑定

测试报错了,好像是sqlSession的问题

警告: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@67ad6302 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: 

java.sql.SQLException: The server time zone value '???????????????????????±' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:127)

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:95)

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:87)

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:61)

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:71)

at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:76)

at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:862)

at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:444)

at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:230)

at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:226)

at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)

at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)

at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)

at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)

at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)

at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)

at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)

at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value '???????????????????????±' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

at sun.reflect.GeneratedConstructorAccessor8.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:422)

at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:59)

at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:83)

at com.mysql.cj.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:128)

at com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2201)

at com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2225)

at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1391)

at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:993)

at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:852)

... 11 more


数据库的properties信息都是对的,配置也没看出啥问题,这个是什么原因?

正在回答

3 回答

lz解决了吗 我也是这个问题

0 回复 有任何疑惑可以回复我~

我猜你是不是这个问题:你改下username试试吧,不要叫做username都行

https://img1.sycdn.imooc.com//5b65eb3300010ba714510604.jpg

0 回复 有任何疑惑可以回复我~

https://img1.sycdn.imooc.com//5b6056790001f50112790112.jpg你用的jdbcDrives是高版本的把,在url那里设置时区试试?或者用低版本的驱动


高版本的是 com.mysql.cj.jdbc.Driver
低版本的是com.mysql.jdbc.Driver
jdbc.mysql.url = jdbc:mysql://localhost:3306/jdbctest?useUnicode=true&characterEncoding=UTF8&useSSL=false&serverTimezone=GMT


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

测试报错了,好像是sqlSession的问题

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信