使用 mysql -uroot 登陆测试是否成功,如果成功修改root密码:
mysql>use mysql;
mysql> update user set password=passworD("test") where user=‘root‘;
mysql> flush privileges;
mysql> exit;
在先启动hadoop服务下,在其中hive:
启动hive服务:
hive --service metastore&
启动hive服务在后台运行:
hive --service hiveserver2 &
接着启动 hive客户端:
hive
如果进入 hive> shell中证明起启动成功;
首先创建表:
hive> CREATE EXTERNAL TABLE MYTEST(num INT, name STRING)
> ROW FORMAT DELIMITED FIELDS TERMINATED BY ‘\t‘ //分隔符 ‘\t’
> ;
导入数据:
hive> load data local inpath ‘/tmp/hive.txt‘ overwrite into table MYTEST;
Copying data from file:/tmp/hive.txt
Copying file: file:/tmp/hive.txt
Loading data to table default.mytest
Deleted hdfs://localhost:9000/user/hive/warehouse/mytest
OK
Time taken: 0.402 seconds
查看数据:
hive> SELECT * FROM MYTEST;
OK
NULL NULL
22 world
33 hive
Time taken: 0.089 seconds
hive>
最后看看/tmp/hive.txt 文档:
sina@ubuntu:~/hive/conf$ cat /tmp/hive.txt
11,hello
22 world
33 hive
sina@ubuntu:~/hive/conf$
hadoop中hive配置mysql
标签:overwrite software any span stand 导入 rod cat 移动
本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉
本文系统来源:http://www.cnblogs.com/tong775131501/p/6366188.html