mysql的time_zone问题。5.7

今天测试mysql的连接时,控制台打印如下错误:

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.

此时测试所用url:

String mysqlURL = "jdbc:mysql://localhost:3306/blogs?useSSL=true";

在网上查找以后将测试url改为:

String mysqlURL="jdbc:mysql://localhost:3306/blogs?sserverTimezone=GMT%2b8&useSSL=true";

再测试的时候就成功了。

转自:

https://segmentfault.com/q/1010000005020300

你可能感兴趣的:(mysql相关)