简体   繁体   中英

Can't connect to server on SQL Server Management Studio 2008

When I open the Management Studio and try to connect using the [PCNAME]/SQLEXPRESS it shows this error:

"Cannot connect to [PCNAME]\\SQLEXPRESS"


ADDITIONAL INFORMATION:

Error Message:

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)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=-1&LinkId=20476 "

I've also tried "localhost", "local" and "." in the place for [PCNAME] but to no avail.

Make sure SQL Server (SQL Express) service is running.

in powershell prompt type:

Get-Service -Name 'MSSQL$SQLEXPRESS'

service "status" property should be reported as "Running"

If it is not, type (you need to be in elevated prompt, ie "Run as Administrator"):

Start-Service -Name 'MSSQL$SQLEXPRESS'

OR

click start > type cmd and type

sc query MSSQL$SQLEXPRESS

State should be reported as "Running"

If it is not, type (you need to be in elevated prompt, ie "Run as Administrator"):

sc start MSSQL$SQLEXPRESS

If you get an error that the service cannot be found: Open SQL server Configuration Manager and make sure you have SQL server express installed:在此处输入图片说明

打开你的 sqlserver 配置管理器 启用你的 tcpip sqlserver 和 express 以及客户端协议 anf 尝试关闭你的防火墙这将允许远程连接

如果不是从 services.msc 启动它,首先检查 sql server 是否正在运行,然后添加 .\\SQLEXPRESS 它将解决问题

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