Centos: Sqlcmd:错误:Microsoft ODBC Driver 13 for SQL Server:TCP提供程序:错误代码0x2749。

4

我已经在Centos 7上安装了MSSSQL。安装完成后,当我尝试通过sqlcmd连接SQL时,出现以下错误。

[root@S*03****k ~]# sqlcmd -S 127.0.0.1 -U sa -P H*****3
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : TCP Provider: Error code 0x2749.
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..

root@S*****k ~]# netstat -ntpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      699/sshd            
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      793/master          
tcp6       0      0 :::80                   :::*                    LISTEN      704/httpd           
tcp6       0      0 :::22                   :::*                    LISTEN      699/sshd    

Can anyone help?

1个回答

1
经过许多天的浪费,我发现这是由于停止的SQL服务造成的。我已尝试启动,但无论如何它都无法运行。每次我检查MSSQL服务都失败了,我的虚拟服务器上有超过5 GB的内存。
“r*****k:〜#sudo systemctl status mssql-server”
mssql-server.service-Microsoft SQL Server数据库引擎 已加载:loaded(/lib/systemd/system/mssql-server.service; enabled; vendor preset:enabled) 活动:未活跃(已死)(结果:退出代码),自2017年11月17日星期五15:39:39 UTC以来;1分37秒前
Process: 4906 ExecStart=/opt/mssql/bin/sqlservr (code=exited, status=255)
Main PID: 4906 (code=exited, status=255)

Nov 17 15:39:39 SV0*****com systemd[1]: mssql-server.service: Unit entered failed state.

Nov 17 15:39:39 SV0*****com systemd[1]: mssql-server.service: Failed with result 'exit-code'.

Nov 17 15:39:39 SV0*****.com systemd[1]: mssql-server.service: Service hold-off time over, scheduling restart.

Nov 17 15:39:39 SV0*****.com systemd[1]: Stopped Microsoft SQL Server Database Engine.

Nov 17 15:39:39 SV0*****.com systemd[1]: mssql-server.service: Start request repeated too quickly.

Nov 17 15:39:39 SV0*****.com systemd[1]: Failed to start Microsoft SQL Server Database Engine.

最终,我创建了一个新的虚拟机,SQL服务正常工作。SQL数据库按预期工作。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接