0

I just installed SQL Server on my Windows Server 2012 R2 box. The installation went well but my apps can't connect to it.

If I use the public DNS name for the server in the connection string, the stack trace looks like this:

[Win32Exception (0x80004005): Access is denied]

[SqlException (0x80131904): 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]

If I use the server's IP address, this:

[Win32Exception (0x80004005): The network path was not found]

[SqlException (0x80131904): 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]

I see its the same error both ways but I've been poking at this for 3 hours and haven't been able to find the problem.

Here's what I've done:

  1. I've verified that remote connections are allowed
  2. I've verified that ports 1433 and 1434 are open on the firewall for incoming and outgoing traffic (both the Windows Firewall and the AWS Security Group)
  3. I've verified that port 1433 is specified for TCP/IP in SQL Server Configuration Manager
  4. I've restarted the SQL Server service
  5. I've checked netstat -a and there's nothing listening on those ports despite all of the above.
  6. I've verified that SQL Server and related services are, in fact, running
  7. I've verified that TCP/IP is enabled - this server serves my websites and under Configuration Manager, TCP/IP is marked as enabled.

I don't know what else to do so if anyone has any suggestions...

  • 1
    I've checked netstat -a and there's nothing listening on those ports despite all of the above - That's the problem. You can't connect to SQL Server if it isn't listening on the configured ports. Have you verified that the SQL Server service is running? Aside from verifying the port in SQL Server Configuration Manager, have you verified that TCP/IP is enabled? – joeqwerty Sep 4 '18 at 21:20
  • @joeqwerty Yes I've verified its running. This server also serves my websites and my email, so pretty sure TCP/IP is enabled. It also says enabled in Configuration Manager – Ortund Sep 5 '18 at 6:44
  • I meant TCP/IP in SQL Server Configuration Manager. You have to make sure it's enabled under SQL Server Network Configuration|Protocols for MSSQLSERVER. – joeqwerty Sep 5 '18 at 12:53
  • @joeqwerty it says there are no items to show in that view – Ortund Sep 5 '18 at 16:28
  • Have you confirmed that Named Pipes is enabled in the SQL Config Manager? I'd also recommend verifying that the connection string is using the security method that is expected (e.g AD Auth vs SQL Auth), and that protocol is enabled (SQL Auth is not enabled by default). – RyanB Oct 8 '18 at 22:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.