You must configure either the server or JDBC driver (via the serverTimezone conf

错误提示

Fri May 17 14:55:39 CST 2019
There was an unexpected error (type=Internal Server Error, status=500).
nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLSyntaxErrorException: Identifier name 'netsafe&useunicode=true&characterencoding=utf-8&allowmultiqueries=true&usessl=false' is too long ### The error may exist in com/infosec/netsafess/mapper/UserMapper.java (best guess) ### The error may involve com.infosec.netsafess.mapper.UserMapper.getAllUser ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLSyntaxErrorException: Identifier name 'netsafe&useunicode=true&characterencoding=utf-8&allowmultiqueries=true&usessl=false' is too long
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLSyntaxErrorException: Identifier name 'netsafe&useunicode=true&characterencoding=utf-8&allowmultiqueries=true&usessl=false' is too long
### The error may exist in com/infosec/netsafess/mapper/UserMapper.java (best guess)
### The error may involve com.infosec.netsafess.mapper.UserMapper.getAllUser
### The error occurred while executing a query
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLSyntaxErrorException: Identifier name 'netsafe&useunicode=true&characterencoding=utf-8&allowmultiqueries=true&usessl=false' is too long
	at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77)
	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)
	at com.sun.proxy.$Proxy60.selectList(Unknown Source)
	at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230)
	at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147)
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80)
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58)
	at com.sun.proxy.$Proxy64.getAllUser(Unknown Source)
	at com.infosec.netsafess.service.impl.UserServiceImpl.getAllUser(UserServiceImpl.java:19)
	at com.infosec.netsafess.controller.HelloController.getAllUser(HelloController.java:25)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

解决办法

//在url后加下面这个
?serverTimezone=UTC

//完整版的
spring.datasource.url=jdbc:mysql://localhost:3306/netsafe&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false

你可能感兴趣的:(日常bug解决)