1、cannot find com.mysql.jdbc.driver
原因:jar包版本不对,我的mysql服务器安装的版本是 mysql-8.0.23-winx64 ,也有说法jdk1.8需要8.0.0+
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.11</version>
</dependency>
2、MySQL JDBC Driver 8.0+设置服务器时区
查看MYSQL服务器设置的时区信息 show variable like '%time_zone%';
会导致mysql报错:
### Error querying database. Cause: 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.
解决: 修改时区
===2024-01-10===============
如果mysql有字段是保留关键字,查询时,需要使用 `usage` -键盘左上角第二行第一个