Not able to import data from MySQL using sqoop. Please help



0
[cloudera@localhost sqoop]$ bin/sqoop import --connect jdbc:mysql://192.168.220.1/world --table city --username root -P --target-dir /user/cloudera/class-8/sqoopOutput -m 2
Enter password: 
18/04/25 03:10:08 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
18/04/25 03:10:08 INFO tool.CodeGenTool: Beginning code generation
18/04/25 03:10:10 ERROR manager.SqlManager: Error executing statement: java.sql.SQLException: Access denied for user 'root'@'hp-PC' (using password: YES)
java.sql.SQLException: Access denied for user 'root'@'hp-PC' (using password: YES)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3603)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3535)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:934)
	at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4104)
	at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1299)
	at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2338)
	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2371)
	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2163)
	at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:794)
	at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
	at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:378)
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)
	at java.sql.DriverManager.getConnection(DriverManager.java:582)
	at java.sql.DriverManager.getConnection(DriverManager.java:185)
	at org.apache.sqoop.manager.SqlManager.makeConnection(SqlManager.java:801)
	at org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:52)
	at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:660)
	at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:683)
	at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:240)
	at org.apache.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:223)
	at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:347)
	at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1277)
	at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1089)
	at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:96)
	at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:396)
	at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:502)
	at org.apache.sqoop.Sqoop.run(Sqoop.java:145)
	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
	at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:181)
	at org.apache.sqoop.Sqoop.runTool(Sqoop.java:220)
	at org.apache.sqoop.Sqoop.runTool(Sqoop.java:229)
	at org.apache.sqoop.Sqoop.main(Sqoop.java:238)
18/04/25 03:10:10 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: No columns to generate for ClassWriter
	at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1095)
	at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:96)
	at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:396)
	at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:502)
	at org.apache.sqoop.Sqoop.run(Sqoop.java:145)
	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
	at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:181)
	at org.apache.sqoop.Sqoop.runTool(Sqoop.java:220)
	at org.apache.sqoop.Sqoop.runTool(Sqoop.java:229)
	at org.apache.sqoop.Sqoop.main(Sqoop.java:238)

[cloudera@localhost sqoop]$ 
grant ALL privileges ON *.* TO root@192.168.199.138 IDENTIFIED BY 'root' WITH GRANT OPTION	0 row(s) affected, 1 warning(s): 1287 
Using GRANT statement to modify existing user's properties other than privileges is deprecated and will be removed in future release. Use ALTER USER statement for this operation.

 


4 Answer(s)


0

Hi Abhishek,

Could you please ensure you are using the correct password while connecting and permission is granted to correct IP:

ERROR manager.SqlManager: Error executing statement: java.sql.SQLException: Access denied for user 'root'@'hp-PC' (using password: YES)
java.sql.SQLException: Access denied for user 'root'@'hp-PC' (using password: YES)

Please make sure you have flush the permission after the grant command.
Please share the output of the following command:
1. Windows - ipconfig
2. Cloudera - ifconfig

 


0

On running grant warning is coming

grant ALL privileges ON *.* TO root@192.168.199.138 IDENTIFIED BY 'root' WITH GRANT OPTION

0 row(s) affected, 1 warning(s): 1287

Using GRANT statement to modify existing user's properties other than privileges is deprecated and will be removed in future release. Use ALTER USER statement for this operation.

PLease tell me another commnd to grant priviledges

Windows - 192.168.220.1

Cloudera - 192.168.199.138


0

Hi Abhishek,

The GRANT command is now depreciated and may be not available from later version after MySQL 8.0. But it just a warning for now and it work correctly. So, you can ignore the warning for now.

As I requested could you please share the complete output of the ipconfig command in Windows.

The ipconfig command contains all the hardware information and IP set attached to the hardware. I need more information about the IP set used by your system and VM virtual hardware.
 

I request you to please share the complete output of the ipconfig command.

Thanks.


0

[cloudera@localhost bin]$ ifconfig
eth1      Link encap:Ethernet  HWaddr 00:0C:29:AE:16:DB  
          inet addr:192.168.199.138  Bcast:192.168.199.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:91619 errors:0 dropped:0 overruns:0 frame:0
          TX packets:42950 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:19637570 (18.7 MiB)  TX bytes:3346010 (3.1 MiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:9139956 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9139956 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:7686780313 (7.1 GiB)  TX bytes:7686780313 (7.1 GiB)

 


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