1.连接MySQL的时候报错The server time zone value,出现这个报错的是因为mysql的时区问题:
url
: jdbc
:mysql
://localhost
:3306/orderingsystem
?useUnicode
=true&characterEncoding
=UTF
-8&serverTimezone
=GMT
%2B8
2.Access denied for user ‘root’@‘localhost’ (using password: YES) ,出现这个报错的原因:root用户的密码错误
3.连接数据库时出现的Public Key Retrieval is not allowed错误,在项目的JDBC连接数据库的url中,加上allowPublicKeyRetrieval=true参数,已验证可以解决该问题。
jdbc
:mysql
://localhost
:3306/xxx
?useUnicode
=true&characterEncoding
=utf8
&rewriteBatchedStatements
=true&useSSL
=false&serverTimezone
=UTC
&allowPublicKeyRetrieval
=true
4.Could not create connection to database server. 更新mysql-connector-java版本:
<!-- https
://mvnrepository
.com
/artifact
/mysql
/mysql
-connector
-java
-->
<dependency>
<groupId>mysql
</groupId
>
<artifactId>mysql
-connector
-java
</artifactId
>
<version>8.0.11</version
>
</dependency
>