Hive试图schematool -dbType mysql -initSchema时候报错如下:

Metastore connection URL:     jdbc:mysql://Desktop:3306/hive?characterEncoding=utf8&useSSL=false
Metastore Connection Driver :     com.mysql.cj.jdbc.Driver
Metastore connection User:     appleyuchi
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version.
Underlying cause: com.mysql.cj.jdbc.exceptions.CommunicationsException : Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
SQL Error code: 0
Use --verbose for detailed stacktrace.
*** schemaTool failed ***

(Python3.6) appleyuchi@Desktop:~$ netstat -an|grep 3306
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN     
tcp6       0      0 :::33060                :::*

问题就出在当前节点外界不可访问,根据[1]处理之后

(Python3.6) appleyuchi@Desktop:~$ netstat -an|grep 3306
tcp6       0      0 :::3306                 :::*                    LISTEN     
tcp6       0      0 :::33060                :::*                    LISTEN

再次初始化hive数据库:

schematool -dbType mysql -initSchema

成功

问题的原因是:

hive-site.xml中的Desktop:3306不可访问,所以要把mysql设置成远程可以访问的。

Reference:

[1]mysql8设置局域网访问

Underlying cause: com.mysql.cj.jdbc.exceptions.CommunicationsException : Communications link failure相关推荐

  1. mac之idea连接MySQL数据库报com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

    项目场景: 最近入手了一台MacBookPro(谨慎尝试,用惯了windos后使用感具别扭,需要大量时间来适应),下载了最新的idea和最新的mysql8.0.23,然后开始了漫长而艰辛的开始,各种没 ...

  2. com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

    com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure 数据库jdbc连接异常,数据库连接异 ...

  3. 【Linux 报错】com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure The las

    报错信息如下: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failureThe last pa ...

  4. 连接数据库报错com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure的解决方法

    控制台报错 Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure com. ...

  5. Druid 连接池 报错 com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

    场景赘述 早晨查看项目前一天的实际运行日志,发现了 一个Springboot项目中的druid 连接池和 mysql 产生了异常信息,重连暂并未对系统产生影响 下面是具体报错信息: com.mysql ...

  6. 解决:com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure(真实有效)

    数据库连接失败 在数据库连接失败,经常会有蛮多一系列的问题导致的原因,这个时候一定要多去尝试一下各种方法,并且做好自己的梳理! 一.例如我在SpringBoot项目中使用了阿里的数据库连接池Driud ...

  7. 数据库连接失败报错com.mysql.cj.jdbc.exceptions.CommunicationsException

    1.问题: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure The last pac ...

  8. Failed to obtain JDBC Connection; nested exception is com.mysql.cj.jdbc.exceptions.CommunicationsEx

    我的是再宿主机连接虚拟机的时候报的这个错 The last packet sent successfully to the server was 0 milliseconds ago. The dri ...

  9. CommunicationsException: Communications link failure; 项目启动遇到数据库报错

    1. 问题 今天启动项目突然报此错误 2. 原因之一 MySQL服务没有启动 3. 解决办法 启动MySQL服务,本地的启动方法(查看方法),打开任务管理器(ctrl+shift+esc),选择顶部的 ...

最新文章

  1. 矩阵奇异值分解简介及C++/OpenCV/Eigen的三种实现
  2. linux基础(6)-shell编程
  3. Golang和Ethereum中的big.Int
  4. 消息中间件kafka概述和安装
  5. springmvc01
  6. Dedecms会员中心注入漏洞
  7. 软件漏洞-泛微OA-汇总
  8. AT32F437基于LVGL的仪表显示案例
  9. Ecshop模板开发(二十三):手机版显示商城
  10. 用摄像管替换电视机电路里的显现管的摄像机
  11. STM32CubeMX和STM32CubeIDE组合,定义STM32开发新方式
  12. css3 如何画太极 和 奥运五环
  13. ESC/POS 打印机指令
  14. 智能视频分析系统 PVG-VA
  15. html分享到微信朋友圈代码,微信分享给朋友及朋友圈JS代码
  16. Python基础-DAY16
  17. moment 农历_设计农历新年赠品
  18. android 意图过滤,Android 意图(Intent)及过滤器(Filter).pdf
  19. HTTP状态码含义:428、429、431、511431状态码详解
  20. Springboot+Mybatis+通用Mapper多数据源实现数据同步

热门文章

  1. 文件夹操作之判断是否存在(Directory)
  2. 第五十四天 how can I 坚持
  3. POJ3026 bfs+prim
  4. sqlite mysql pgsql_SQLite 、MySQL 与PostgreSQL三个关系型数据库的比较
  5. bio阻塞的缺点_java 中的 BIO/NIO/AIO 详解
  6. (六)JS基础知识三(走进作用域和闭包)【三座大山之二,不会闭包,基本不会通过】
  7. arraylist如何检测某一元素是否为空_java学习笔记:【ArrayList集合】
  8. 哈工大计算机学院庞,奋斗在知足与知不足之间――我与我的导师计算机学院马培军教授二三事...
  9. 遍历一个ul设置各个li不同的样式
  10. java返回json格式的状态码数据(二)