您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

spring boot 连接数据库问题

bubuko 2022/1/25 19:32:56 java 字数 932 阅读 931 来源 http://www.bubuko.com/infolist-5-1.html

小白,刚入spring boot 框架,今天测试练习时遇到这样一个问题 The server time zone value '?й???????' is unrecognized or represents more than one time zone. You must configure e ...

小白,刚入spring boot 框架,今天测试练习时遇到这样一个问题

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.

翻译后:

服务器的时区 value ‘?й? ? ? ? ? ? ?’ 未被识别或代表多个时区。您必须配置服务器或JDBC驱动程序(通过serverTimezone配置属性),如果您想要利用时区支持,则需要使用更特殊的时区值。

 

其实是为了使MySQL JDBC驱动程序与UTC时区配合使用,必须在连接字符串中明确指定serverTimezone。

 

spring.datasource.url=jdbc:mysql://localhost:3306/demo?serverTimezone=UTC
这个样子就OK了

 

spring boot 连接数据库问题

原文:https://www.cnblogs.com/tangmai/p/13345553.html


如果您也喜欢它,动动您的小指点个赞吧

除非注明,文章均由 laddyq.com 整理发布,欢迎转载。

转载请注明:
链接:http://laddyq.com
来源:laddyq.com
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


联系我
置顶