问题完整提示:
Exception in thread "main" 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 specific time zone value if you want to utilize time zone support.
中文翻译:
线程“主”java.sql中的异常。SQLException异常:服务器时区价值”�й���ʱ��的识别或代表多个时区。如果想利用时区支持,必须配置服务器或JDBC驱动程序(通过“serverTimezone”配置属性)以使用更具体的时区值。
导致原因:由于时区问题引起。
解决方法:
将数据库连接对象中的url
加上:?serverTimezone=GMT%2B8
或者
?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8