解决办法:【sqlserver】Cannot connect to XXXX\SQLEXPRESS

来源:互联网 发布:淘宝镜子 编辑:程序博客网 时间:2024/06/16 13:32

问题描述今天上午同事的开发机出现了一个特别搞笑的问题,原来好用的sqlserver,现在本地连接不了,一点connect就出现如下错误信息。
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)



原因分析:1.sqlserver本地服务已经停止,造成无法访问。

2.sqlserver的Network Configuration的TCP/IP为disable状态,或者TCP/IP的属性中TCP Port没有设置默认端口1433,造成远程无法访问。

解决办法(1) 针对第一种情况,开启sqlserver服务即可,第一种方式是在windows服务中直接开启(进入windows服务找到SQL Server服务,右键start即可)。另一种方式是通过sqlserver的Configuration Tools开启(Start > All Programs > SQL Server 2005 > Configuration Tools > SQL Server 2014 Configuration Manager 中SQL Server Services > 右侧 SQL Server服务 Stopped -> Running即可。)。

(2) 针对第二种情况,进入SQL Server网络配置工具中(Start > All Programs > SQL Server 2005 > Configuration Tools > SQL Server 2014 Configuration Manager -> SQL Server Network Configuration) 确认TCP/IP的状态为Enable状态,并且更改其ip port为1433(双击TCP/IP -> IP Adresses -> 拉倒最下面IPALL


本文原创由`bluetata`发布于blog.csdn.net、转载请务必注明出处。


Flag Counter

阅读全文
1 0