简体   繁体   中英

TCP/IP connection to the port is failed. sqoop jdbc connection error

When i try to run the sqoop command to import

sqoop import --connect jdbc:sqlserver://localhost/db_name--username 
user--password user--table table_name.

I get the following error.

ERROR: The TCP/IP connection to the host 127.0.0.1, port 1433 has failed. Error: "Connection refused: connect. 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.".

Both my named pipes and TCP/IP are enabled and have port 1433. SQL server TCP/IP protocol also has port 1433. I have created firewall inbound and outbound rules to allow connection.Still I am getting the same error.

Please try to add sqljdbc42.jar to sqoop lib path and add

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

to your sqoop import command.

Also make sure that there should be a space between db_name and --username and space between username and --password and no dot at the end of the command.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM