Reputation: 440
I have 5 records in employee table in demo_poc database in MySQL in
192.168.1.126 [Machine-1].
I want to import the data into hive in
192.168.1.129 [Machine-2] using Sqoop.
I Installed sqoop 1.4.6 on Machine-2.
I tried like this,
sqoop import --connect jdbc:mysql://192.168.1.126:3306/demo_poc
--username root --password root --table employee -m 10
--hive-import --hive-table demo_poc.address
Here is the error I received,
16/04/11 16:28:20 INFO tool.CodeGenTool: Beginning code generation
16/04/11 16:28:21 ERROR manager.SqlManager: Error executing statement: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
16/04/11 16:28:21 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: No columns to generate for ClassWriter
Any suggestions. Thanks.
Upvotes: 1
Views: 544
Reputation: 1
for example : sqoop import --connect "mysql://192.168.1.126:3306/demo_poc "
--username root
--password "root"
--query "select column_name from table_name where \$CONDITIONS"
--fields-terminated-by ',' --target-dir /user/.... -m 1 --delete-target-dir --as-parquetfile
Upvotes: 0
Reputation: 440
sqoop-import --connect jdbc:mysql://192.168.1.126:3306/demo_poc --username root --P --table employee -m 1 --hive-import --hive-table demo_poc.employee
Upvotes: 1
Reputation: 1
The IP addresses which you provided looks like in the same network. If these two machines are in the network then the ping command will able to work. After we enter the ping 'I.P of MYSQL' then communication will etsablishes.
MYSQL>grant all privileges on . to ''@'192.168.1.129' MYSQL>grant all privileges on . to '%'@'192.168.1.129' above two commands executed on MYSQL machine by admin.
Upvotes: 0
Reputation: 5239
This error occurs due to many reasons. You can start with this,
Upvotes: 0