2019-03-22Mysql版本升级过程中遇到的一些问题

错误一:

web应用中连接mysql数据库时后台会出现这样的提示:

Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

原因是MySQL在高版本需要指明是否进行SSL连接。解决方案如下:

在mysql连接字符串url中加入ssl=true或者false即可,如下所示。

url=jdbc:mysql://127.0.0.1:3306/framework?characterEncoding=utf8&useSSL=true

解决方案源自:
https://blog.csdn.net/liuguangsh/article/details/72518244

错误2:

提示信息表明数据库驱动com.mysql.jdbc.Driver'已经被弃用了、应当使用新的驱动com.mysql.cj.jdbc.Driver'

所以,按照提示更改jdbc.properties配置 .com.mysql.jdbc.Driver 改为 com.mysql.cj.jdbc.Driver

解决方案源自:
https://blog.csdn.net/weixin_42323802/article/details/82500458

错误3:

解决MySQL报错The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents .....

方法一:SpringBoot2.1在你没有指定MySQL驱动版本的情况下它自动依赖的驱动是8.0.12很高的版本,这是由于数据库和系统时区差异所造成的,在jdbc连接的url后面加上serverTimezone=GMT即可解决问题,如果需要使用gmt+8时区,需要写成GMT%2B8,否则会被解析为空。再一个解决办法就是使用低版本的MySQL jdbc驱动,5.1.28不会存在时区的问题。

image.png

方法二: 修改MySQL的配置文件,MySQL配置文件是my.ini文件在你的安装目录下去找,我的是在C:\Program Files (x86)\MySQL\MySQL Server 5.5\my.ini

解决方案源自:
https://blog.csdn.net/qq_37630354/article/details/82814330

你可能感兴趣的:(2019-03-22Mysql版本升级过程中遇到的一些问题)