Unable to create JOB in SQOOP Unable to create JOB in SQOOP hadoop hadoop

Unable to create JOB in SQOOP


There is a small change that you need to make in your sqoop command. The right syntax would be

bin/sqoop job --create myjob -- import --connect jdbc:mysql://localhost/test --username root --password root --table PATIENT -m 1 --target-dir /Sqoop/MRJob

[ Note: "--" and a space before the import. Secondly, use POSIX notation "--" before username and password. Thirdly use upper case to specify table name ] it should work.

Few standards: use Options file to store credentials (user name, password and connect string) and pass it as as a parameter to --options-file. Hope this helps.


Try to write below command.

gopal@ubuntu:~$ `sqoop job --create JobName -- import --connect jdbc:mysql://localhost/DatabaseName --table tablename -m1 --target-dir /OutPutDirectoryName;`


It's better to set SQOOP_PATH in .bashrc and run

user@hostname:~$ gedit .bashrc

add following lines in .bashrc file

export SQOOP_HOME=/usr/lib/sqoopexport PATH=$PATH:$SQOOP_HOME/bin

Now, you can run sqoop job by

sqoop import --connect jdbc:mysql://localhost/test --username root --password root --table patient --m 1 --target-dir /Sqoop/MRJob