错误标识
The server time zone value ‘�й���ʱ��’ is unrecognized
异常日志
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.
解决办法
1、解决The server time zone方法:
配置mysql连接时区:UTC是统一标准世界时间
jdbc:mysql://localhost:3306/连接的数据表库?serverTimezone=UTC
2、解决‘�й���ʱ��’ 方法:
jdbc:mysql://127.0.0.1:3306/连接的数据表库?useUnicode=true&characterEncoding=UTF-8
3、结合
jdbc:mysql://127.0.0.1:3306/连接的数据表库?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
我的代码
如果发现数据库连接的 URL中“&”报错,那就接着往下看:
将 & 改为 &emp;