django使用mysql引擎连接mysql时报错:
java.lang.RuntimeException: com.mysql.cj.exceptions.InvalidConnectionAttributeException: 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后加上 ?serverTimezone=GMT%2B8
全部url为:jdbc:mysql://127.0.0.1:3306/blog?serverTimezone=GMT%2B8