Tags

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Follow Setting Up MySQL Database for Big Data for the example

  • Create table Test in MySQL for use.

Create table test(ename varchar(20));

insert into test values(‘aaa1’);

insert into test values(‘aaa2’);

insert into test values(‘aaa3’);

insert into test values(‘aaa4’);

insert into test values(‘aaa5’);

insert into test values(‘aaa5’);

  • Exit sql by typing exit; at command line.
  • Type “hive” to start Hive command line.
  • Run below command for import,

hive>sqoop import –connect jdbc:mysql://localhost:3306/test –username demo –password welcome1
–table test –hive-import –create-hive-table -m 1

it will create a table in hive with name test and import records from test table created in mysql.

hive>show tables;

it will show list of tables. check test table must be there in the list;

hive> select * from test;

it will list all records from test table.

Advertisements