Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connect to remote SQL Server - network-related or instance-specific error

I can't connect to a remote SQL Server.

I get this error:

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)

On the remote machine, the SQL Server is running and port 1433 is open.

In my Visual Studio Server Explorer, the data connection to the remote database shows a little red cross. The state is closed. - I can't see the remote pc in the server name select field. But I can successfully ping the remote computer.

How to connect to the server?

EDIT:

My connection string: {Data Source=wsbd0311\SQLEXPRESS;Initial Catalog=rms;User ID=sa;Password=mypassword} (I can login with this Id and password.)

I allready set "Allow remote connctions to this server" on the remote SQL Server.

EDIT No.2:

Do I need to have an open port 1434 on the remote SQL Server?

like image 385
kame Avatar asked Mar 19 '26 20:03

kame


1 Answers

Make sure the server is running on the remote pc. Connect to the remote pc and check whether the SQL server instance is running on it by All Programs -> SQL Server -> SQL Server Configuration Manager -> Under SQL Server Services check whether the SQL Server service is on running state. If not try starting the service and connecting. Furthermore Enable TCP/IP under the Protocols for MS SQL Server which comes under SQL Server Network Configuration.

like image 82
ChathurawinD Avatar answered Mar 22 '26 14:03

ChathurawinD



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!