解决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问题


错误提示:
Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is 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.
 
 
解决办法;
 
在连接字符串后面加上?serverTimezone=UTC

其中UTC是统一标准世界时间。

完整的连接字符串示例:jdbc:mysql://localhost:3306/test?serverTimezone=UTC

或者还有另一种选择:jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8,这个是解决中文乱码输入问题,当然也可以和上面的一起结合:jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



猜您在找 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. 使用JDBC连接MySql时出现: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 springboot启动过程中出现You must configure either the server or JDBC driver (via the serverTimezone configuration 关于MySql升级JDBC架包导致时区问题报错(The server time zone value '?й???????' is unrecognized or represents more than one time zone) 解决JDBC连接MySQL 8时得异常:java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone. 关于“Cannot resolve table 'user'”报错及运行日志报java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone的问题解决 mysql运行报The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone的解决方法 The server time zone value '???ú±ê×??±??' is unrecognized or represents more than one time zone.错误解决办法以及原因 mysql异常之: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone
 
粤ICP备18138465号  © 2018-2026 CODEPRJ.COM