I'm trying to connect to a SQL Server Express database instance on a remote server. I've taken the following steps to make this possible:
- Enabled Windows AND Sql authentication
- Allowed for remote connections
- Enabled TCP/IP
- Enabled Named pipes (\.\pipe\MSSQL$SQLEXPRESS\sql\query)
For Windows Firewall I tried the following:
- Added [path]\Binn\sqlservr.exe to exceptions
- Added port 1433 to exceptions
- Checked port in SQL Server log to which it is listening (1114) and added that to exceptions
Then I tried to connect through Sql Server Management Studio using the following server names:
- \[ipaddress]\pipe\MSSQL$SQLEXPRESS\sql\query
- [ipaddress]\SQLEXPRESS
Both fail with the error shown below. Am I missing something here?
Connect to Server: 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) (Microsoft SQL Server, Error: 53)
(I can ping the server by the way...)
netstat -noab >"%userprofile%\Desktop\netstat.txt"
A non-default instance will not have a listening port number assigned by default and this could explain your connection failure.