今天在使用mybatis的时候忘记自己把MySql
升级了为8.0
的版本,导致出现这个错误
报错的配置文件dp.properties
:
driver=com.mysql.cj.jdbc.Driver
url=jdbc:mysql://localhost:3306/mybatis?useSSL=false&useUnicode=true&characterEncoding=UTF-8
user=root
password=123456
在数据库升级为8.0
的版本之后需要在其中的URL
中加入时区的配置serverTimezone=GMT
修改后的配置文件dp.properties
driver=com.mysql.cj.jdbc.Driver
url=jdbc:mysql://localhost:3306/mybatis?useSSL=false&useUnicode=true&allowPublicKeyRetrieval=true&characterEncoding=UTF-8&serverTimezone=GMT
user=root
password=123456