2013-09-26 63 views
-2

我试图通过SQOOP连接SQL服务器,但得到下面的错误:sqoop从SQL Server进口2008

sqoop import --connect 'jdbc:sqlserver://localhost:1433;username=kashif;password=sqoop;database=Northwind' --table Department -m 1; 
13/09/26 04:41:22 INFO SqlServer.MSSQLServerManagerFactory: Using Microsoft's SQL Server - Hadoop Connector 
13/09/26 04:41:22 INFO manager.SqlManager: Using default fetchSize of 1000 
13/09/26 04:41:22 INFO tool.CodeGenTool: Beginning code generation 
13/09/26 04:41:37 ERROR manager.SqlManager: Error executing statement: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed. Error: "Connection refused. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.". 
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed. Error: "Connection refused. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.". 

我已经下载了sqoop SQL连接器,并把它放在/ usr/lib中/ sqoop/lib目录文件夹也。

我也检查过端口1433是否启用了TCP连接。

你能指导我吗?

回答

0

试试这个,更换必要的IP用户ID PWD和db等,

sqoop进口--connect “的jdbc:SQLSERVER://123.23.231.2;数据库= MYDB” --username SA --password SA --driver com.microsoft.sqlserver.jdbc.SQLServerDriver --table“mytable'--targer-dir”/ tmp/mytable'