zxq997

2019-06-26   阅读量: 1301

hive连接MySQL时有ssl警告

扫码加入数据分析学习群

在hive连接MySQL时有ssl警告,警告内容如下:

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.

警告会重复出现非常麻烦,怎么解决呢 ?

答:这个警告是说:

不建议在没有服务器身份验证的情况下建立SSL连接。根据MySQL 5.5.45+、5.6.26+和5.7.6+的要求,如果没有设置显式选项,必须默认建立SSL连接,因为如果不使用SSL,那么verifyserver证书属性将被设置为“false”。您需要通过设置useSSL=false来显式地禁用SSL,或者设置useSSL=true,并为服务器证书验证提供信任存储。

我们可以设置useSSL=false来显式地禁用SSL连接,那在哪里设置呢?其实这个参数是在jdbc连接mysql的时候设置的,设置方法修改hive-site.xml的javax.jdo.option.ConnectionURL参数

 <property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNoteExist=true&amp;useSSL=false</value>
</property>
60.9670 3 1 关注作者 收藏

评论(0)


暂无数据

推荐课程