Centos:Sqlcmd:错误:用于SQL Server的Microsoft ODBC驱动程序13:TCP提供程序:错误代码0x2749

时间:2017-11-14 16:12:16

标签: sql-server linux tcp centos7

我在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    

有人可以帮忙吗?

1 个答案:

答案 0 :(得分:0)

浪费了这么多天后,我发现这是由于Stopped SQL Service而发生的。我试图开始,但有些人如何不起床。 每次我检查MSSQL服务失败时,我的虚拟服务器上都有超过5 GB的内存。

  

r ***** k:〜#sudo systemctl status mssql-server

●mssql-server.service - Microsoft SQL Server数据库引擎  已加载:已加载(/lib/systemd/system/mssql-server.service;已启用;供应商预设:已启用) 活动:非活动(死)(结果:退出代码)自2017年5月15日星期五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数据库按预期工作。