1
votes

When I install sqoop it gives me this error.

sqoop git:(derektest) ✗ bin/sqoop-list-databases –connect jdbc:mysql://localhost/ --username root -p
readlink: illegal option -- f
usage: readlink [-n] [file ...]
usage: dirname path
bin/sqoop-list-databases: line 26: /Users/apple/sqoop: is a directory
bin/sqoop-list-databases: line 26: exec: /Users/apple/sqoop: cannot execute:
Undefined error: 0

Really hope someone could help me with this. This is killing me now.

1
can you format you command and console output and error properly. Its not readable. Also are you trying to install sqoop with this command or validating installation by listing databases? - pradeep
i install the sqoop with brew. I try to figure out if it has been installed well. - Derek Wang
➜ 1.4.5 git:(master) bin/sqoop-help readlink: illegal option -- f usage: readlink [-n] [file ...] usage: dirname path /usr/local/Cellar/sqoop/1.4.5/libexec/bin/sqoop-help: line 26: /Users/apple/sqoop: No such file or directory /usr/local/Cellar/sqoop/1.4.5/libexec/bin/sqoop-help: line 26: exec: /Users/apple/sqoop: cannot execute: No such file or directory - Derek Wang
This is the command i typed. And it gives me this error. But the problem is there is no "/users/apple/sqoop" directory. - Derek Wang

1 Answers

0
votes

It is happening because of "readlink" which is installed as coreutils in MacOS.

use greadlink (installed as part of brew install coreutils)

for example, for the file = bin/sqoop-list-databases on line number 26 replace readlink with greadlink like following

prgm=`greadlink -f $0`
bin=`dirname ${prgm}`
bin=`cd ${bin} && pwd`
...