我尝试使用 sqoop 命令列出 MS SQL 中的数据库
sqoop list-databases --connect jdbc:sqlserver://10.x.x.x --username my_usrnme --password my_pwd
它可以正确列出 SQL Server 中的所有数据库。
但是当我尝试使用命令列出特定数据库中的表时
sqoop list-tables --connect jdbc:sqlserver://10.x.x.x/db_name --username my_usrnme --password my_pwd
我收到的错误为
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host 10.x.x.x/db_name, port 1433 has failed. Error: "null. Verify the
connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port."
有人遇到过这个问题吗?
最佳答案
我的查询在稍微更改命令后有效
sqoop list-tables --connect 'jdbc:sqlserver://10.x.x.x;database=db_name' --username my_usrnme --password my_pwd
需要的是,servername 和 dbname 必须位于 ' '(单引号)中并用 ; 分隔。 (分号)。
关于hive - 无法使用 SQOOP 列出 MS SQL 中的表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32503889/