none
Unable to connect remotely to SQL Server 2012 Express

    Question

  • Hi, when I try to connect remotely to my SQL Server (Express 2012) I get this error:

    +  $exception {"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)"} System.Exception {System.Data.SqlClient.SqlException}

    I have tried every thing I can think of to make this work including:

    1. Started SQL Server Browser

    2. Enabled TCP/IP

    3. Enabled port 1435 in my firewall (Not that I disabled firewall to double check it was not the firewall causing a problem).

    4. Enabled "Allow Remote Connections to this Server" in SQL Server Manager Studio

     

    Connections work fine if my app that connects to the server is run locally on the server that has SQL installed. Just fails if connection from other machines.

     

    This is my connection string:

     

    sqlConnection =

    newSqlConnection(@"Data Source=SERVER IP\SQLEXPRESS;Initial Catalog=GameServices;User Id=sa;Password=PASSWORD");

    Where SERVER IP I replace with my servers IP and PASSWORD with the real password.               

    Any ideas?

     

    Thanks,

    --Mike

     

     

    Thursday, August 16, 2012 6:37 PM

Answers

  • Mike,

    The default port for SQL Server is 1433 on TCP not 1435. Did you also enable the browser service and allow UDP port 1434?

    Can you ping the IP successfully?

    -Sean


    Sean Gallardy, MCC | Blog | Twitter

    • Marked as answer by Strahan Thursday, August 16, 2012 9:45 PM
    Thursday, August 16, 2012 8:35 PM

All replies

  • Mike,

    The default port for SQL Server is 1433 on TCP not 1435. Did you also enable the browser service and allow UDP port 1434?

    Can you ping the IP successfully?

    -Sean


    Sean Gallardy, MCC | Blog | Twitter

    • Marked as answer by Strahan Thursday, August 16, 2012 9:45 PM
    Thursday, August 16, 2012 8:35 PM
  • Adding UDP port 1434 did the trick.

    I also changed my TCP port to 1433 (which I'm guessing was also necessary).

    Thanks!

    Thursday, August 16, 2012 9:46 PM