您的位置:首页 > 数据库 > MySQL

连接mysql数据库时Establishing SSL connection without server's identity verification is not recommended.

2017-08-03 08:01 579 查看
[Thu Aug 03 08:00:35 CST 2017 WARN: 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.]

根据上面warn:    设置SSL=true就行了,具体如下 :在url后面加上useSSL=true就行了,

URL="jdbc:mysql://localhost:3306/ssm?useSSL=true"

注意的是,如果但用的jar包高于数据库的版本过不了。

此处使用的mysql-connector为

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.42</version>

</dependency>

数据库的版本为:5.7.17-log

查询mysql的版本号可使用:

SELECT VERSION(); 

mysql的驱动可在maven仓库中找:
https://mvnrepository.com/artifact/mysql/mysql-connector-java
用的时候注意版本就行了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐