java.sql.SQLException: The server time zone value … is unrecognized or represents more than one

  • Post author:
  • Post category:java




标题

在这里插入图片描述



解决办法

url的时区使用中国标准时间。也是就 serverTimezone=Asia/Shanghai

在这里插入图片描述


解决后的写法:


"jdbc:mysql://localhost:3306/scott?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai";