Share via

Microsoft SQL Server connectivity issue from computer within network

Stan Matth 1 Reputation point
2021-08-09T15:08:01.58+00:00

I'm hosting an SQL server on a pc that runs ubuntu. I can connect using SSMS with a windows laptop through vpn which gives me a local ip like 10.0.8.0.
However a windows pc that is within the same subnet can't connect with the same credentials that i use with my laptop. The error i get is
"Named Pipes Provider, error: 40 - Could not open a connection to SQL Server" I've tried to specify the server instance and different connection methods.
I even tried to set up a second sql server outside my network and connecting with the troubled pc (also through vpn) ... and that somehow works.
So my question is: what is allowing connections with devices that are in the network through vpn and excluding devices that are in the same subnet?
Is my servername flat out wrong?
ive tried: the localip of the server (which works on vpn), the name of the server (which doesnt work anywhere), the localip and a server instance name...

SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories


1 answer

Sort by: Most helpful
  1. CathyJi-MSFT 22,431 Reputation points Microsoft External Staff
    2021-08-10T03:12:52.367+00:00

    Hi @Stan Matth ,

    This is a default SQL server instance or named instance? For SQL server named instance, we can using below connection string on server name box.

    Server name\instance name
    Ip, port number

    > Named Pipes Provider, error: 40 - Could not open a connection to SQL Server

    Please follow below steps to troubleshot the issue,

    1. Make sure SQL Server Service is running
    2. If a named instance, make sure SQL Server browser service is running. Make sure the instance name is spelled correct and there is actually such an instance on your target machine.
    3. Make sure SQL Server is configured to allow remote connections
    4. Examine the SQL Server error log for messages confirming that SQL is listening on the expected network interfaces and ports
    5. Test server connectivity with PING from the client machine
    6. Test port connectivity using TELNET to the server and port (from step 4) from the client machine. For example
      TELNET <server-name> 1433
    7. Check firewall settings if step 5 or 6 connectivity test fails

    If you have some confuse about the steps, please refer to Resolving could not open a connection to SQL Server errors or Troubleshoot connecting to the SQL Server Database Engine to get more information.


    If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar thread.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.