1、在连接数据库时,发现错误:
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.
解决方法:
application.yml配置文件,url后面加上?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&s
spring:
application:
name: cop-yeyw-demo
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/yeyw_db?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
username: yeyw
password: 941207