Connect to SQL Server 2008 with TCP/IP

前端 未结 8 2028
眼角桃花
眼角桃花 2020-12-05 16:16

I get the following error when I try to connect with TCP/IP from SQL Server Management Studio. I need a step by step description to solve my problem. What\'s wrong here?

相关标签:
8条回答
  • 2020-12-05 16:22

    There is a good walkthrough for configuring this, including

    • Enabling TCP/IP protocol for the database server
    • Enabling remote connections for the database server
    • Allowing the TCP traffic through the firewall

    at http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx.

    0 讨论(0)
  • 2020-12-05 16:25

    When you check the SQL Server Network Configuration (Start Menu > Microsoft SQL Server > Configuration Tools > SQL Server Configuration Manager > SQL Server Network Configuration), what do you see?

    Is the TCP/IP protocol really enabled on your server? It's off by default, and stays off in most cases (unless you specifically turn it on).

    Just using a IP-based server address doesn't mean you're connecting using the TCP/IP protocol.... check http://www.connectionstrings.com/sql-server-2008 for a sample connection string that will use TCP/IP:

    Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;
    

    The key is the Network Library=DBMSSOCN; which tells your code to connect using TCP/IP.

    0 讨论(0)
  • 2020-12-05 16:26

    Also worth checking that the SQL Server Browser Service is running as TCP/IP connections will use this service

    0 讨论(0)
  • 2020-12-05 16:30

    Follow this:

    Start -> Programs -> Microsoft SQL Server 2008 -> Configuration Tools -> SQL Server Configuration Manager

    SQL Server network Configuration -> Protocols for [SQLInstanceName]

    Right click TCP/IP -> Enable

    0 讨论(0)
  • 2020-12-05 16:36

    If TCP/IP is already enabled then it sounds like your firewall is blocking the connection. Open the relevant ports and it should work.

    You should check the firewall on both ends of the connection.

    0 讨论(0)
  • 2020-12-05 16:38

    Have a look at www.connectionstrings.com. Error message looks like you're using named pipes and not tcp/ip. Don't forget you must enable TCP/IP on server machines for SQL Server explicitly.

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