Install Sqoop and export table data from MySQL to a text file under HDFs

Source: Internet
Author: User
Tags sqoop

The first is to install the MySQL database. Installation is complete using the sudo apt-get install mysql-server command. The table is then created and the data is inserted:

Then download the Sqoop and the jar package that connects to the MySQL database. The next step is to install Sqoop. The first is to configure the sqoop-env.sh file:

Then comment out the Config-sqoop file that does not need to be checked:

The next step is to copy the Sqoop-1.4.4.jar package and the jar that connects MySQL to the Lib directory in the Hadoop directory, and copy the Hadoop-core-1.2.1.jar package to the Sqoop Lib directory. Then start Sqoop successfully.

The following is the export of the Dept table in the MySQL database to HDFs: The Export command is: Sqoop import jdbc:mysql://localhost:3306/mysql--username root--password "--table dept-m 1

Then we look at the results.

Come here, finally got it! The data exchange between the relational database and HDFs is realized.

Install Sqoop and export table data from MySQL to a text file under HDFs

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.