Hive交互方式
第一种交互方式:Hive交互shell cd / export / servers / hive - 1.1 .0 - cdh5 . 14.0 bin / hive 查看所有的数据库 hive ( default ) > show databases ; 创建一个数据库 hive ( default ) > create database myhive ; 使用该数据库并创建数据库表 hive ( default ) > use myhive ; hive ( myhive ) > create table test1 ( id int , name string ) ; 以上命令操作完成之后,一定要确认mysql里面出来一个数据库hive 第二种交互方式:Hive JDBC服务 启动hiveserver2服务 前台启动 cd / export / servers / hive - 1.1 .0 - cdh5 . 14.0 bin / hive -- service hiveserver2 后台启动 cd / export / servers / hive - 1.1 .0 - cdh5 . 14.0 nohup bin / hive -- service hiveserver2 & beeline连接hiveserver2 bin / beeline beeline > !