1. Error description
Before encountering this error, it is now the version of MySQL that is 6. A few versions, the previous version of 5 did not have the problem:
Solution:
Add a. SERVERTIMEZONE=UTC after the connection string where UTC is the uniform standard world time. Complete Connection String Example: JDBC:MYSQL://LOCALHOST:3306/TEST?SERVERTIMEZONE=UTC or another option: Jdbc:mysql://127.0.0.1:3306/test? Useunicode=true&characterencoding=utf-8, this is to solve the Chinese garbled input problem, of course, can also be combined with the above: Jdbc:mysql://127.0.0.1:3306/test? Useunicode=true&characterencoding=utf-8&servertimezone=utc
2, the use of Springboot integration MyBatis when found @mapper annotations can not be used, but also because of the version of the reason, so this piece to pay attention to.
3, Error: annotation callout on the interface or implementation class, I labeled @service on the interface, the result indicates that the service class could not be found?
@Service annotations are labeled on an interface or an implementation class?
@ServiceAnnotations are labeled on the implementation class, because they @Service are spring instantiated in the container bean ,
That is, the equivalent of the new operation, only 实现类 can be new instantiated, and 接口 then not, so is added to 实现类 the.
Bottom line: The spring container is instantiated and the interface cannot be instantiated, only the implementation class can.
You can also learn from this blog:
77159213
MySQL, MyBatis encounters a problem collection