检查从Linux服务器(例如Ubuntu18.04)到远程Microsoft 2017实例的连接的最简单方法是什么?
发布于 2019-07-13 18:43:18
我认为最简单的方法是尝试从命令行向MS SQL server发送telnet:
$ telnet <server-name-or-ip> 1433
如果连接成功,屏幕将变为空白,否则您将看到“连接到服务器名-或-ip.无法打开到主机的连接,在端口1433:连接失败”。
发布于 2020-05-24 11:44:24
另一种简单的方法是从命令行使用nc
(netcat
):
nc -zv YOUR_SERVER_NAME_OR_IP 1433
如果可以建立连接,您应该会看到这样的输出:
Connection to YOUR_SQL_SERVER_NAME_OR_IP 1433 port [tcp/ms-sql-s] succeeded!
如果失败,则根据原因得到不同的错误消息:
nc: getaddrinfo for host "NON_EXISTING_SQL_SERVER_NAME_OR_IP" port 1433: Name or service not known
或者也许..。
nc: connect to YOUR_SQL_SERVER_NAME_OR_IP port 143 (tcp) failed: Connection timed out
从nc
手册页,z
和v
选项如下:
-z Specifies that nc should just scan for listening daemons, without sending any
data to them. It is an error to use this option in conjunction with the -l
option.
-v Have nc give more verbose output.
https://serverfault.com/questions/975149
复制相似问题