Skip to main content
ledel
Gold ⭐️
Gold ⭐️
May 12, 2016 9:00 AM UTC

sqoop wrong password with password-file

  • Oct 5, 2026 9:40 AM UTC
  • 1 reply
  • 2586 views
  • Translate All

Using Sqoop (Sql from/to Hadoop), you can use a password file instead of a plaintext password, which is more secure :

<arg>--password-file</arg>
<arg>hdfs://NAMENODE/teradata.password</arg>

You may end with error like

3737 [main] ERROR org.apache.sqoop.teradata.TeradataSqoopExportHelper - Exception running Teradata export job
com.teradata.connector.common.exception.ConnectorException: java.sql.SQLException: [Teradata Database] [TeraJDBC 15.00.00.20] [Error 8017] [SQLState 28000] The UserId, Password or Account is invalid.

If you set your “Password” pass with vi you’ll end with a line feed control character, making the password invalid.

To find if there’s a LF ending the password file, use od (display file in octal format):

[root@localhost ~]# od -c teradata.password
0000000 P a s s w o r d \n
0000011

You’ll have to delete your newline control character using tr :

[root@localhost ~]# tr -d '\n' < teradata.password > teradata.password.new
[root@localhost ~]# od -c teradata.password.new
0000000 P a s s w o r d
0000010

1 reply

nyaddanapudi
Silver ⭐️⭐️
May 12, 2016 5:44 PM UTC

Nice post @Laurent Edel we can also use $ echo -n "password" > teredata.password

Translate