我正在尝试通过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文件夹中。
我还检查了端口1433是否已启用TCP连接。
你能指导我吗?
答案 0 :(得分:0)
试试这个,替换必要的ip userid pwd和db等,
sqoop import --connect“jdbc:sqlserver://123.23.231.2; database = mydb”--username sa --password sa --driver com.microsoft.sqlserver.jdbc.SQLServerDriver --table“mytable” - -targer-dir“/ tmp / mytable'