springboot 常见报错分析(持续更新,欢迎补S充)
数据库相关
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.
原因:数据库链接配置未指定时区- 中文数据库插入乱码
原因:数据库链接配置未指定编码
解决: 完整的数据库配置
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/database name?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
spring.datasource.username=yourname
spring.datasource.password=yourpassword