jdbc连接数据库的时候报如下错误:
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
原因:MySQL jdbc 6.0 版本以上必须配置“serverTimezone”参数
我们使用的是北京时间,所以可以选用Asia/Shanghai或者Asia/Hongkong,如果想用全球标准时间就使用serverTimezone=UTC,但是这个时间比我们北京时间晚8个小时。
参考文章
com.mysql.cj.exceptions.InvalidConnectionAttributeException
最新推荐文章于 2023-10-29 15:15:55 发布