Using Sqoop to import MySQL data into hive

Source: Internet
Author: User
Tags sqoop

Reference

Http://www.cnblogs.com/iPeng0564/p/3215055.html

Http://www.tuicool.com/articles/j2yayyj

http://blog.csdn.net/jxlhc09/article/details/16856873

1.list databases

Sqoop list-databases--connect jdbc:mysql://192.168.2.1:3306/--username sqoop--password sqoop

2. Create a hive table with Sqoop

Sqoop create-hive-table--connect jdbc:mysql://xx:3306/test?characterencoding=utf-8--table employee--userna Me Root-password ' xx '--hive-database db_hive_edu

3.import data

#sqoop Import--connect jdbc:mysql://xx:3306/test?characterencoding=utf-8--table employee--username Root-password ' xx '--fields-terminated-by ', '--hive-import--hive-database db_hive_edu-m 1


--fields-terminated-by ', ' causes data to become null


Sqoop import--connect jdbc:mysql://xx:3306/test?characterencoding=utf-8--username root-password ' xx '--table Employee--hive-import--hive-database db_hive_edu-m 1


650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/9A/07/wKioL1lQh__waDjzAABs9h_1ukc926.png-wh_500x0-wm_ 3-wmp_4-s_219995857.png "style=" float:left; "title=" Sogou 20170626120236.png "alt=" Wkiol1lqh__wadjzaabs9h_ 1ukc926.png-wh_50 "/>



This article from "Want to have a dream, in case the realization of" blog, declined reprint!

Using Sqoop to import MySQL data into hive

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.