参考
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.用sqoop创建hive表
sqoop create-hive-table --connect jdbc:mysql://xx:3306/test?characterEncoding=UTF-8 --table employee --username root -password ‘xx‘ --hive-database db_hive_edu
3.import数据
#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 ‘,‘ 导致数据变成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
截图