详细的错误日志为:
NestedThrowables:
java.sql.SQLException: Unable to open a test connection to the given database. JDBC url = jdbc:mysql://192.168.1.186:3306/hive?createDatabaseIfNotExist=true&useSSL=false, username = hive. Terminating connection pool (set lazyInit to true if you expect to start your database after your app). Original Exception: ------
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
今天启动Hive时候出现的错误,谷歌半天,找到了最终的解决办法,将conf/hive-site.xml中的内容更换为:
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true&useSSL=false</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>
最主要的地方是jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true&useSSL=false,一定要替换为localhost(主机名或者ip地址都会报错,就很傻逼),并且要设置useSSL=false(不使用安全认证)!!!文章来源:https://www.toymoban.com/news/detail-718578.html
然后就可以正常启动hive。文章来源地址https://www.toymoban.com/news/detail-718578.html
到了这里,关于com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure(Hive连接MySQL报错)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!