异常如下:
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.
解决:
打开mysql安装目录下D:\install\MySQL\MySQL Server 8.0的my.ini
找到[mysqld]添加一行default-time-zone=+08:00
效果如下:
[mysqld]
default-time-zone=+08:00
然后重启mysql服务即可