Enable remote connections for SQL Server Express 2012

前端 未结 17 824
栀梦
栀梦 2020-11-22 03:33

I just installed SQL Server Express 2012 on my home server. I\'m trying to connect to it from Visual Studio 2012 from my desktop PC, and repeatedly getting the well-known e

相关标签:
17条回答
  • 2020-11-22 04:29

    All you need to do is open the relevant port on the server's firewall.

    0 讨论(0)
  • 2020-11-22 04:31

    One More Thing...

    Kyralessa provides great information but I have one other thing to add where I was stumped even after this article.

    Under SQL Server Network Configuration > Protocols for Server > TCP/IP Enabled. Right Click TCP/IP and choose properties. Under the IP Addresses you need to set Enabled to Yes for each connection type that you are using.

    enter image description here

    0 讨论(0)
  • 2020-11-22 04:33

    The correct way to connect to remote SQL Server (without opening UDP port 1434 and enabling SQL Server Browser) is to use ip and port instead of named instance.

    Using ip and port instead of named instance is also safer, as it reduces the attack surface area.

    Perhaps 2 pictures speak 2000 words...

    This method uses the specified port (this is what most people want I believe)..

    enter image description here

    This method requires opening UDP port 1434 and SQL Server Browser running..

    enter image description here

    0 讨论(0)
  • 2020-11-22 04:34

    In my case the database was running on non standard port. Check that the port you are connecting is the same as the port the database is running on. If there are more instances of SQL server, check the correct one.

    0 讨论(0)
  • 2020-11-22 04:35

    I had a different problem from what all of the answers so far mentioned!

    I should start off by saying that I had it in Visual Studio, and not SQL Server Express but the solution should be exactly the same.

    Well, god, it's actually really simple and maybe a bit foolish. When I tried to create a database and Visual Studio suggested the name of the SQL Server it gave me my Windows username and since it's actually the name of the server I went for it.

    In reality it actually was my Windows username + \SQLEXPRESS. If you didn't change any settings this is probably yours too. If it works, stop reading; this is my answer. If it doesn't work maybe the name is different.

    If, like me, you only had this problem in Visual Studio to check what is yours follow these steps:

    1. Open SQL Server Management Studioicon.
    2. If you don't see your server (docked to the left by default) press F8 or go to View -> Object Explorer.
    3. Right click on the name of the server and choose Properties (The last item)
    4. At the bottom left you can see your server's actual name under "Server" (not Connection, but above it).

    This is the name of the server and this is what you should attempt to connect to! not what Visual Studio suggests!

    0 讨论(0)
提交回复
热议问题