Late but not least, I think I am going to give the answer part here in this thread
similar issue I were facing with sqoop in importing the table data from host windows machine to virtual box guest ubuntu os, just because of my windows host machine installed mysql server username doesn't have sufficient privileges for granting connection and schema over remote request.
So, now not talking much on issue I am illustrating the issue I were facing -
vm4learning@vm4learning:~/Installations/sqoop-1.4.4$ bin/sqoop import --connect jdbc:mysql://192.168.56.1/india --table india_most_populated_cities --target-dir /user/vm4learning/remotedir/ --username root --password password -m 1
no main manifest attribute, in /home/vm4learning/Installations/hbase-0.94.14/lib/coprocessor.jar
find: paths must precede expression: sqoop-test-1.4.4.jar
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
Warning: $HADOOP_HOME is deprecated.
17/12/06 11:01:10 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
17/12/06 11:01:11 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
17/12/06 11:01:11 INFO tool.CodeGenTool: Beginning code generation
17/12/06 11:01:13 ERROR manager.SqlManager: Error executing statement: java.sql.SQLException: Access denied for user 'root'@'Administrator' (using password: YES)
java.sql.SQLException: Access denied for user 'root'@'Administrator' (using password: YES)
Then, I came to my windows host machine, run ipconfig from cmd and first get the ipaddress of the host machine and in linux(ubuntu) it is "ifconfig":
Ethernet adapter VirtualBox Host-Only Network:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::54d4:4f16:4bdb:885%18
IPv4 Address. . . . . . . . . . . : 192.168.56.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
So here my ip address is 192.168.56.1 in windows host machine and then I login into mysql through command in windows host and run below said scripts for granting the privilege -
mysql -u root -p
Enter password: ********
mysql> GRANT ALL ON . TO root@'192.168.56.1' IDENTIFIED BY 'password';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
that's it, and then I go the guest ubuntu machine inside virtual box (by doing this my windows were connected with wifi internet) and re-run the same above said sqoop command and that imports my desired table data to the cluster.
I would like to share the lines I got after successfully script run -
vm4learning@vm4learning:~/Installations/sqoop-1.4.4$ bin/sqoop import --connect jdbc:mysql://192.168.56.1/india --table india_most_populated_cities --target-dir /user/vm4learning/remotedir/ --username root --password password -m 1
no main manifest attribute, in /home/vm4learning/Installations/hbase-0.94.14/lib/coprocessor.jar
find: paths must precede expression: sqoop-test-1.4.4.jar
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
Warning: $HADOOP_HOME is deprecated.
17/12/06 17:00:55 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
17/12/06 17:00:55 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
17/12/06 17:00:55 INFO tool.CodeGenTool: Beginning code generation
17/12/06 17:00:58 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `india_most_populated_cities` AS t LIMIT 1
17/12/06 17:00:58 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `india_most_populated_cities` AS t LIMIT 1
17/12/06 17:00:58 INFO orm.CompilationManager: HADOOP_MAPRED_HOME is /home/vm4learning/Installations/hadoop-1.2.1
Note: /tmp/sqoop-vm4learning/compile/fc8e526de8f7a74171941455a22f573f/india_most_populated_cities.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
17/12/06 17:01:02 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-vm4learning/compile/fc8e526de8f7a74171941455a22f573f/india_most_populated_cities.jar
17/12/06 17:01:02 WARN manager.MySQLManager: It looks like you are importing from mysql.
17/12/06 17:01:02 WARN manager.MySQLManager: This transfer can be faster! Use the --direct
17/12/06 17:01:02 WARN manager.MySQLManager: option to exercise a MySQL-specific fast path.
17/12/06 17:01:02 INFO manager.MySQLManager: Setting zero DATETIME behavior to convertToNull (mysql)
17/12/06 17:01:02 INFO mapreduce.ImportJobBase: Beginning import of india_most_populated_cities
17/12/06 17:01:06 INFO mapred.JobClient: Running job: job_201712061003_0002
17/12/06 17:01:07 INFO mapred.JobClient: map 0% reduce 0%
17/12/06 17:01:29 INFO mapred.JobClient: map 100% reduce 0%
17/12/06 17:01:36 INFO mapred.JobClient: Job complete: job_201712061003_0002
17/12/06 17:01:37 INFO mapred.JobClient: Counters: 18
17/12/06 17:01:37 INFO mapred.JobClient: Job Counters
17/12/06 17:01:37 INFO mapred.JobClient: SLOTS_MILLIS_MAPS=24525
17/12/06 17:01:37 INFO mapred.JobClient: Total time spent by all reduces waiting after reserving slots (ms)=0
17/12/06 17:01:37 INFO mapred.JobClient: Total time spent by all maps waiting after reserving slots (ms)=0
17/12/06 17:01:37 INFO mapred.JobClient: Launched map tasks=1
17/12/06 17:01:37 INFO mapred.JobClient: SLOTS_MILLIS_REDUCES=0
17/12/06 17:01:37 INFO mapred.JobClient: File Output Format Counters
17/12/06 17:01:37 INFO mapred.JobClient: Bytes Written=10406
17/12/06 17:01:37 INFO mapred.JobClient: FileSystemCounters
17/12/06 17:01:37 INFO mapred.JobClient: HDFS_BYTES_READ=87
17/12/06 17:01:37 INFO mapred.JobClient: FILE_BYTES_WRITTEN=80423
17/12/06 17:01:37 INFO mapred.JobClient: HDFS_BYTES_WRITTEN=10406
17/12/06 17:01:37 INFO mapred.JobClient: File Input Format Counters
17/12/06 17:01:37 INFO mapred.JobClient: Bytes Read=0
17/12/06 17:01:37 INFO mapred.JobClient: Map-Reduce Framework
17/12/06 17:01:37 INFO mapred.JobClient: Map input records=271
17/12/06 17:01:37 INFO mapred.JobClient: Physical memory (bytes) snapshot=81043456
17/12/06 17:01:37 INFO mapred.JobClient: Spilled Records=0
17/12/06 17:01:37 INFO mapred.JobClient: CPU time spent (ms)=2530
17/12/06 17:01:37 INFO mapred.JobClient: Total committed heap usage (bytes)=49807360
17/12/06 17:01:37 INFO mapred.JobClient: Virtual memory (bytes) snapshot=973082624
17/12/06 17:01:37 INFO mapred.JobClient: Map output records=271
17/12/06 17:01:37 INFO mapred.JobClient: SPLIT_RAW_BYTES=87
17/12/06 17:01:37 INFO mapreduce.ImportJobBase: Transferred 10.1621 KB in 33.9572 seconds (306.4444 bytes/sec)
17/12/06 17:01:37 INFO mapreduce.ImportJobBase: Retrieved 271 records.
Hope it will help you and also bring my post the answer of this thread, thanks.