Search code examples
hadoopsqoop

Sqoop --password-file give bad substitution error


I am new to hadoop, trying to run following sqoop command:

sqoop import --connect jdbc:mysql://localhost:3306/vaibhav --table employees --username root --password-file ${user.home}/.password.txt --target-dir /data/sqoop/eg4/ -m 2

but it gives me an error as

bash: ${user.home}/.password.txt: bad substitution

I tried the way it is given in the docs, but nothing happened. same error every time. Step by step guide would be appreciated. Thanks


Solution

  • Sqoop expects the password file on HDFS location. Try copying the file to a location on HDFS and specify that path. Also check the read permission of the file. Read permission should be to given to home directory user.