Sqoop Failed with Password file

Hello Durga Sir, I tried to use password file and execute below command. It is not working. Would you please help.

sqoop list-tables --connect jdbc:mysql://quickstart.cloudera:3306/retail_db --username retail_dba --password-file /home/cloudera/.password

[cloudera@quickstart ~]$ ls -ltr /home/cloudera/.password
-rwxr-xr-x 1 cloudera cloudera 9 Dec 5 21:19 /home/cloudera/.password

[cloudera@quickstart ~]$ cat /home/cloudera/.password
cloudera

@Murali_Rachakonda, can you check this URL if you havent already http://blog.ervits.com/2015/03/running-saved-sqoop-144-jobs-with.html

Try to copy the password file into hdfs file system and then try to run the same command as it worked for me.

@Murali_Rachakonda, Thumb Rule is “–password-file should be in HDFS location and not in the Local file system”.

However, if you want to still pass it from a file and from the local file system then please use -options-file in the Sqoop script.

Refer : Information: Use --options-file in sqoop to use mention the arguments that do not change from invocation to invocation

Could you please confirm - Is this is the case with older version of sqoop ?

Now, I can see in the official sqoop documentation 1.4.6 - We can have password-file either in Local FS or HDFS.