I want to save the password to a file and then use it in the sqoop command.
According to sqoop documentation --password-file, we can store a password. therefore, I store it in the pwd file only with the password text abc. and executes the command below.
sqoop import --connect jdbc:mysql://localhost:3306/db --username bhavesh --password-file /pwd --table t1 --target-dir '/erp/test'
Assuming the pwd file is stored on HDFS
As a result, I get the following error:
java.sql.SQLException: Access denied for user 'bhavesh'@'localhost' (using password: YES)
When I perform the same operation using the -p option, it works fine for me.
source
share