I want to store the password into a file & later use the same in sqoop command.
According to sqoop documentation --password-file
option allow us for storing password. so i am storing it in pwd file with password abc text only. & hits the below command.
sqoop import --connect jdbc:mysql://localhost:3306/db --username bhavesh --password-file /pwd --table t1 --target-dir '/erp/test'
assuming pwd file is stored over HDFS
as a result i am getting following error :
java.sql.SQLException: Access denied for user 'bhavesh'@'localhost' (using password: YES)
When I perform the same operation using -p option it works fine for me.