驱动,com.mysql.cj.jdbc.Driver 连接数据库,启动项目控制台报错:
java.sql.SQLException: The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone
解决方法:
url连接加上 serverTimezone=CTT
spring:
datasource:
url: jdbc:mysql://localhost:3306/test?serverTimezone=CTT&characterEncoding=utf-8

本文解决了一个常见的MySQL数据库连接问题,当使用com.mysql.cj.jdbc.Driver驱动时,控制台可能出现的时区错误:Theservertimezonevalue'�й���ʱ��'isunrecognizedorrepresentsmorethanonetimezone。通过在url连接中添加serverTimezone参数,具体设置为CTT,可以有效避免此类错误。
443

被折叠的 条评论
为什么被折叠?



