当前位置: 代码迷 >> 综合 >> 项目过程中遇见的异常
  详细解决方案

项目过程中遇见的异常

热度:65   发布时间:2024-01-26 02:23:40.0

打开以前的旧项目,启动时出现的异常信息:java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'.处理办法升级pom.xml中依赖mysql依赖包版本。

<dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>5.1.21</version>
</dependency><!--旧写法-->
<dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>8.0.11</version>
</dependency>
<!--新版本-->

 修改后再次启动项目,再次报异常

InvalidConnectionAttributeException: 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.

处理办法:

db连接上添加serverTimezone=UTC

jdbc.url=jdbc:mysql://localhost:3306/mzwm?characterEncoding=utf8&&serverTimezone=UTC

  相关解决方案