springcloud坑之 $InternalServerError: 500 null

时间:2025-01-23 10:27:37

springcloud坑之 $InternalServerError: 500 null

今天用springcloud玩了一个微服务,一切都准备就绪,当我用消费方调用生产方的数据时,在消费方的控制台上出现了以下错误信息:

$InternalServerError: 500 null

于是我就按照这个信息在网上找解决方法,但都没有找到。最后我在生产方的控制台上发现了如下错误:

: 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.

所以我就按照这个错误信息,在我的数据源的url后面加上了
?characterEncoding=utf8&serverTimezone=UTC
之前是:

spring:
datasource:
url: jdbc:mysql:///mybatis1

加上之后:

spring:
datasource:
url: jdbc:mysql:///mybatis1?characterEncoding=utf8&serverTimezone=UTC

最后解决了这个问题!