Cannot connect to my database from within SQL Management Studio
The instance is running, but I still cannot connect, I get this error:
TITLE: Connect to Server
------------------------------
Cannot connect to PC-CARLA\SQLEXPRESS.
------------------------------
ADDITIONAL INFORMATION:
Error relacionado con la red o específico de la instancia mientras se establecía una conexión con el servidor SQL Server. No se encontró el servidor o éste no estaba accesible. Compruebe que el nombre de la instancia es correcto y que SQL Server está configurado para admitir conexiones remotas. (provider: Interfaces de red SQL, error: 26 - Error al buscar el servidor o instancia especificado) (Microsoft SQL Server, Error: -1)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=-1&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
Any suggestions on what can be going wrong? Why doesn't this thing connect? :S
How do I find the instance NAME开发者_开发问答 of a server? Why doesn't this work?
You need to enable the correct protocol(s) in your SQL Server Configuration Manager.
It is the second option in the screenshot you provided ("SQL Server Network Configuration").
You need to enable the protocols you need (all of them to make sure?) and then you need to restart the SQLEXPRESS service.
I don't speak whatever language that error message is in, but I'm guessing that it's similar to one that I've seen in a language that I do know. I think it's saying that the target machine may not be configured for remote connections. Whenever I see that, there's either a firewall between the host and client, the specific instance is down, or there is a problem with the SQL browser. As a test, can you telnet to the port that the SQL server is configured to run on?
Ben Thul is correct. You are getting this problem because the SQL Browser service is stopped.
By default (when using the full version of SQL Server but not SQL Express), SQL Server starts up and listens for connections on TCP port 1433. When you connect from SQL Management Studio (or your application) and don't specify a port, it tries to connect using 1433.
However - this is different for SQL Server Express (and other named instances of SQL Server). These start on a dynamic port and rely on the SQL Browser Service (UDP/1434) to provide the mapping between instance name and port.
So, in your example - you try and connect to ServerName\SQLEXPRESS. As it's not the default instance a connection is attempted to the SQL Browser service, which would then respond with the dynamic port of SQL Express (say port 12345). Finally, your SQL client will connect to ServerName port 12345 and will find your named instance.
In short - enable the browser service!
精彩评论