I can't connect to SQL server database via an IP Address

4.3K    Asked by nitin_7621 in Salesforce , Asked on Aug 23, 2021

I have set up a server that runs Windows Server 2008 and has SQL Server 2008 Express installed.

I can connect to the machine's SQL Server Express database via the MACHINENAME/SQLEXPRESS.

However, when we come to connecting through any software or script using an IP Address it won't allow the connection.

  • I have tried:
  • Turning off the Firewall.
  • Allowing Remote Connections for the SQL Database.
  • Enabling TCP/IP within the SQL Configuration.

When we attempt to connect via the software 'SQL Server Management Studio', we get the following message:

Error Message:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.) (Microsoft SQL Server, Error: 10061)

A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - An established connection was aborted by the software in your host machine.) (Microsoft SQL Server, Error: 10053)

Can you please let me know when your free so we can take a look because I seem to be getting know where, I’ve amended the details as per some information UK Fast sent me but they have said "It’s not within the support remit", so they can’t help any further.

Don’t know why getting error can't connect to SQL server? Please suggest me possible solution.

Answered by Sonam Singh

This is 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. The name of the computer hosting the SQL Server.



Your SQL Server is installed as named instance, so first of all try connecting to your server using the following server name: IP AddressSQLEXPRESS.

When you install SQL Server as named instance it uses dynamic TCP/IP ports by default, so it is not possible to connect to it whitout specifying instance name (just IP address).

If you need to connect to your server without using an instance name you have to reconfigure your server to use static TCP port.

To do it please perform the following:

  • open SQL Server Configuration Manager;
  • switch to the SQL Server Network Configuration | Protocols for SQLEXPRESS;
  • double-click the TCP/IP protocol;
  • select the Yes value in the Enabled field;
  • switch to the IP Addresses tab;
  • find the IPAll section;
  • clear the TCP Dynamic Ports field in that section;
  • specify the 1433 value in the TCP Port field:
  • restart your server

Try to connect to your server using just its IP address.

Hope this will resolve your issue.



Your Answer

Answer (1)

If you're unable to connect to a SQL Server database using an IP address, there are a few potential reasons and troubleshooting steps you can try:


Check Server Configuration: Ensure that the SQL Server instance is configured to accept remote connections. This setting is typically found in the SQL Server Configuration Manager under SQL Server Network Configuration -> Protocols for -> TCP/IP. Make sure TCP/IP is enabled.

Firewall Settings: Verify that the firewall on the SQL Server machine (as well as any network firewalls) allows incoming connections on the SQL Server port (default is usually 1433 for SQL Server). You may need to add an inbound rule to allow traffic on this port.

SQL Server Browser Service: If you're connecting using a named instance of SQL Server, ensure that the SQL Server Browser service is running on the server. This service helps clients locate named instances on the network.

Dynamic Ports vs. Static Ports: If the SQL Server instance is configured to use dynamic ports, the port number may change each time the SQL Server service restarts. Consider configuring the SQL Server instance to use a static port instead.

IP Address and Port Number: Double-check that you're specifying the correct IP address and port number when connecting to the SQL Server instance. Ensure there are no typos or mistakes in the connection string.

Network Connectivity: Ensure that there are no network issues preventing communication between your client machine and the SQL Server machine. You can test network connectivity using tools like ping or telnet.

SQL Server Configuration: Check the SQL Server configuration to ensure it is listening on the correct IP address and port. You can use SQL Server Configuration Manager to verify this.

Authentication: Ensure that you're using the correct authentication method (Windows Authentication or SQL Server Authentication) and that the credentials you're providing are valid.

Temporary Disable Antivirus or Security Software: Sometimes, antivirus or security software can block outgoing connections. Temporarily disable such software and try connecting again.

Consult Server Logs: Check the SQL Server error logs for any error messages or clues as to why the connection is failing. These logs can often provide helpful information for troubleshooting.

By systematically checking each of these potential issues, you should be able to identify and resolve the problem preventing you from connecting to the SQL Server database via its IP address.

2 Months

Interviews

Parent Categories