Created on 07-18-2017 05:20 PM - edited 09-16-2022 04:57 AM
I'm trying to use sqoop-export to retrieve data from a cluster. Using either --password or -P to specify the password, the export is working and the table successfully loaded to the Postgres database.
If I use --password-file, either the file isn't being read at all, or the contents are different from what's expected - the end result is I get an LDAP authentication error for an invalid password.
This is the same --password-file parameter and file that I've used successfully to sqoop-import data into the cluster originally. My initial read on this, is that sqoop-export isn't using the --password-file the same way that sqoop-import is using it, and in that difference is also a bug.
I get the same error if I intentionally mistype the password or provide no password.
Works:
sqoop-export --connect jdbc:postgresql://dbserver:port/mydb --username user --password umaypass --table mytable --hcatalog-table mytable
Fails:
sqoop-export --connect jdbc:postgresql://dbserver:port/mydb --username user --password-file file:///home/user/.passfile --table mytable --hcatalog-table mytable
.passfile contains:
umaypass<eof>
I've also tried it with contents of:
umaypass
<eof>
File is located in my local file system at /home/user. I've tried putting the file in HDFS with the same resulting error.
I know there is at least partial support for password-file in sqoop-export - if I specify both the password-file AND --password or -P, then I get an error that it will take only one of those three parameters.
Is anybody using --password-file successfully with sqoop-export?
Created 07-21-2017 10:23 AM
I've 'solved' my problem by using -P. I'll need to manually type my password for each table as I export them, but this is a mostly one-time operation, so the pain is minor.
Created 02-14-2020 02:14 AM
@Asoka wrote:I've 'solved' my problem by using -P. I'll need to manually type my password for each table as I export them, but this is a mostly one-time operation, so the pain is minor.
Sqoop supports reading passwords via standard input (STDIN). You can use this option by with help of — P options with sqoop command. Sqoop will prompt you for the password.
Below is the example of using — P option:
$sqoop import --connect jdbc:netezza://localhost/MYDB \ --username testuser -- P --table ORDERS
Created 02-13-2020 06:00 AM
I think you're passing the hidden file in the --password-file option
sqoop export --connect jdbc:mysql://hostname/test --connection-manager org.apache.sqoop.manager.MySQLManager --export-dir /tmp/version --table HiveVersion --username hive --password-file file:///tmp/mysql-pass.txt
This command worked for me