Sqoop Import error while trying to import from MySql to HDFS



0
[cloudera@localhost ~]$ sqoop import --connect jdbc:mysql://192.168.157.1/DeZyre --table player --username root -P --target-dir /user/cloudera/sqoopOut1 -m 1
Enter password:
14/11/10 10:05:11 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
14/11/10 10:05:11 INFO tool.CodeGenTool: Beginning code generation
14/11/10 10:05:25 ERROR manager.SqlManager: Error executing statement: java.sql.SQLException: null, message from server: "Host 'WINDOWS-M9OD94S' is not allowed to connect to this MySQL server"
java.sql.SQLException: null, message from server: "Host 'WINDOWS-M9OD94S' is not allowed to connect to this MySQL server"
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)

8 Answer(s)


0

Did you try to give grant access from the database to the VM 192.168.157.1? The same error showed up during the class as well. Karan ran a grant statement which would probably be in the blackboard notes that he shares.


0

Thanks!

Yes.. I did. Here is the command I issued to grant privileges. My VM IFConfig address is

[cloudera@localhost sqoop]$ ifconfig
eth1 Link encap:Ethernet HWaddr 00:0C:29:22:C5:02
inet addr:192.168.119.129 Bcast:192.168.119.255 Mask:255.255.255.0

mysql> GRANT ALL PRIVILEGES on *.* TO root@192.168.119.129 IDENTIFIED BY 'root'
WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)


0

But still I am experiencing the same issue as I mentioned above. Any thoughts?

0

hi Thomas,

Once you grant the privileges, you need to execute "flush privileges".

Thanks

0

I tried flush privileges as well. I am getting the same error.

14/11/10 19:03:30 ERROR manager.SqlManager: Error executing statement: java.sql.SQLException: null, message from server: "Host 'WINDOWS-M9OD94S' is not allowed to connect to this MySQL server"
java.sql.SQLException: null, message from server: "Host 'WINDOWS-M9OD94S' is not allowed to connect to this MySQL server"

0

hi Thomas,

If you had followed all steps as specified in the it should have worked anyways, I suggest to install Mysql on VM so that you don't have to face these issues.

here is the video to install Mysql https://www.youtube.com/watch?v=a9vnQ6bGdbI

Thanks

0

I really wanted to try to connect to RDBMS residing outside of VM. Please note that after the installation of mysql, I was able to create database, tables, adding rows etc... All these steps are working fine.

When I tried to execute the command from CDH4 VM, I am getting the below error

[cloudera@localhost ~]$ sqoop import --connect jdbc:mysql://192.168.157.1/DeZyre --table player --username root -P --target-dir /user/cloudera/sqoopOut1 -m 1

Could you please let me know, what's causing the below issue? (i.e.,Host 'WINDOWS-M9OD94S' is not allowed to connect to this MySQL server)


14/11/10 10:05:25 ERROR manager.SqlManager: Error executing statement: java.sql.SQLException: null, message from server: "Host 'WINDOWS-M9OD94S' is not allowed to connect to this MySQL server"
java.sql.SQLException: null, message from server: "Host 'WINDOWS-M9OD94S' is not allowed to connect to this MySQL server"

0

Thomas,

Creating databases and tables has nothing to do with the error that you were getting during Sqoop import. This error is normally caused because there are no permissions for ur VM to connect to Mysql. You really need to had admin level knowledge to execute the required commands.

Please execute all the steps with related to grant permissions. If you are still getting errors please refer to these links

http://stackoverflow.com/questions/8348506/grant-remote-access-of-mysql-database-from-any-ip-address
http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html

Thanks

Your Answer

Click on this code-snippet-icon icon to add code snippet.

Upload Files (Maximum image file size - 1.5 MB, other file size - 10 MB, total size - not more than 50 MB)

Email
Password