Sqoop Password file error


#1

Hello folks,

I am using below command to query departments table with sqoop. I am passing password through a file instead of using the password on CLI.

sqoop eval --connect jdbc:mysql://nn01.itversity.com:3306/retail_db --username retail_dba --password-file ‘/user/sbhupathiraju86/pwdfile.txt’ --query ‘select * from departments’;

Below is the error.

Warning: /usr/hdp/2.5.0.0-1245/accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
18/03/17 00:31:19 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6.2.5.0.0-1245
18/03/17 00:31:20 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
18/03/17 00:31:20 WARN tool.EvalSqlTool: SQL exception executing statement: java.sql.SQLException: Access denied for user ‘retail_dba’@‘172.16.1.113’ (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4187)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4119)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:927)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1709)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1252)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2488)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2521)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2306)
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:839)
at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:49)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

Can some one please suggest a work around to address this error.


#2

@sbhupathiraju

Let me check and figure out this issue ASAP.


#3

@sbhupathiraju

Try below commands:

  1. echo -n “itversity” > /home/sbhupathiraju/pwdfile.txt
  2. hadoop fs -put pwdfile.txt /user/sbhupathiraju/pwdfile.txt
  3. sqoop eval --connect “jdbc:mysql://nn01.itversity.com:3306/retail_db” --username retail_dba --password-file /user/sbhupathiraju/pwdfile.txt --query “select * from departments”

Refer below screenshot:
image


#4