4

Scenario:

I am trying to import from sql server into HDFS, but I am getting errors as:

Error:

hadoop@ubuntu:~/sqoop-1.1.0/bin$ ./sqoop import --connect 'jdbc:sqlserver://192.168.230.1;username=xxx;password=xxxxx;database=HadoopTest' --table PersonInfo --target-dir /home/hadoop/hadoop-0.21.0/

11/12/10 12:13:20 ERROR tool.BaseSqoopTool: Got error creating database manager: java.io.IOException: No manager for connect string: jdbc:sqlserver://192.168.230.1;username=xxx;password=xxxxx;database=HadoopTest
at com.cloudera.sqoop.ConnFactory.getManager(ConnFactory.java:119)
at com.cloudera.sqoop.tool.BaseSqoopTool.init(BaseSqoopTool.java:178)
at com.cloudera.sqoop.tool.ImportTool.init(ImportTool.java:81)
at com.cloudera.sqoop.tool.ImportTool.run(ImportTool.java:411)
at com.cloudera.sqoop.Sqoop.run(Sqoop.java:134)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:69)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:83)
at com.cloudera.sqoop.Sqoop.runSqoop(Sqoop.java:170)
at com.cloudera.sqoop.Sqoop.runTool(Sqoop.java:196)
at com.cloudera.sqoop.Sqoop.main(Sqoop.java:205)

Question:

What is the problem I am not getting? My Hadoop version : hadoop-0.21.0 Sqoop version : sqoop-1.1.0

Pls suggest me solution. Thanks.

Bhavesh Shah
  • 3,299
  • 11
  • 49
  • 73

3 Answers3

2

Your syntax is wrong. Use below syntax

 ./sqoop import --connect jdbc:sqlserver://192.168.230.1:<PORT_NUMBER>/HadoopTest --username xxx --password xxxxx --table PersonInfo --target-dir /home/hadoop/hadoop-0.21.0/

Also make sure that jdbc jasrs should be present in

$SQOOP_HOME/lib
Sanket
  • 194
  • 11
1

As strange as it sounds, the use of the single tic ' to enclose your connection string may be causing problems. If you use double quotes " or nothing at all, it may work better for you - at least it does in my environment.

So, instead of

./sqoop import --connect 'jdbc:sqlserver://192.168.230.1;username=xxx;password=xxxxx;database=HadoopTest' --table PersonInfo --target-dir /home/hadoop/hadoop-0.21.0/

try

./sqoop import --connect "jdbc:sqlserver://192.168.230.1;username=xxx;password=xxxxx;database=HadoopTest" --table PersonInfo --target-dir /home/hadoop/hadoop-0.21.`0/

or

./sqoop import --connect jdbc:sqlserver://192.168.230.1;username=xxx;password=xxxxx;database=HadoopTest --table PersonInfo --target-dir /home/hadoop/hadoop-0.21.0/

Hope it helps.

Jim Hofer
  • 11
  • 1
-2

You need to specify the Drivermanager

--driver com.microsoft.jdbc.sqlserver.SQLServerDriver

haden
  • 164
  • 1
  • 6
  • I don't think there driver should be specified, Sqoop should be loading the appropriate driver from the connect string jdbc:`sqlserver`://192.168.230.1;user.......... It might be a problem of the SQLServer JDBC Driver not being in the class path. – Praveen Sripati Dec 10 '11 at 17:06
  • I am running into the same problem, though I definitely placed sqljdbc4.jar and slqjdbc.jar in the Sqoop library folder (/usr/lib/sqoop/lib) and ran a similar command only to get the same result. I've tried using both jars, and one jar each to see if that would help, but no luck – Eternal Rubyist Jun 12 '13 at 13:02