-2

我正在尝试通过 SQOOP 连接 SQL 服务器,但出现以下错误:

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 文件夹中。

我还检查了是否为 TCP 连接启用了端口 1433。

你能指导我吗?

4

1 回答 1

0

试试这个,替换必要的 ip userid pwd 和 db 等,

sqoop 导入 --connect "jdbc:sqlserver://123.23.231.2;database=mydb" --username sa --password sa --driver com.microsoft.sqlserver.jdbc.SQLServerDriver --table "mytable' --targeter-目录“/tmp/mytable”

于 2013-10-25T15:47:21.127 回答