mysql连接异常:The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zo错误


错误原因:mysql识别时区出现错误,这是因为访问的url中没有指定时区为UTC

出错误的url:

spring.datasource.url=jdbc:mysql://127.0.0.1:3306/springbootdemo?useUnicode=true&characterEncoding=utf8

在后面添加时区的参数数即可:

spring.datasource.url=jdbc:mysql://127.0.0.1:3306/springbootdemo?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC

 


免责声明!

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



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM