SQL Server has lost tcp/ip connectivity, works locally - sql-server

An SQL Server install on a VM was stopped incorrectly this morning. When brought back up, it communicates normally on the local machine. It no longer works on TCP/IP. Attempts to communicate with the server from SSMS on a differnt machine result in
A network-related or instance-specific error occured while establishing a
connection to SQL Server. The server was not found or is not accessible.
Very that the instance name is correct and that the 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 1326)
The user name or password is incorrect
The username and password work fine when they are used locally. Have tested Windows Auth locally, sql user remotely (we don't have a domain)
In SQL Server Configuration Manager > Sql Server Network Configuration > Protocols for MSSQLServer > TCP/IP > IP Addresses everything appears correctly configured. The IPv6 IPv4 addresses are correct, and IPAll has the correct port (default 1433)
The server can ping multiple hosts on the network. They can ping it back. It's only a single non-routeable subnet. 192.168.0.*
The name of the pc matches the name of the sql server from SELECT ##SERVERNAME
The server version is 10.50.6000 which maps to SQL Server 2008 R2

First of all 1433 Port allow in Firewall (Inbound/Outbound rule)
After then try login with
ServerName: IPAddress\InstanceName,1433
Authentication : SQL Server Authentication

Related

Connect IIS in DMZ to SQL Server on intranet

I'm trying to connect IIS which is running on a server in the DMZ to a SQL Server instance on the company intranet. But, I'm getting the following error:
An unhandled exception occurred while processing the request.
Win32Exception: Access is denied.
Unknown location
SqlException: 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)
Do I need specific ports opened up on one of the servers? Or is there something else I need to do?
Considering your SQL server is running, start with the networking. On which port is your SQL instance listening (default 1433)?
If you don't know, open the SQL Server Configuration Manager (on the SQL Server). Navigate to the SQL Server Network Configuration > Protocols for %instancename% > TCP/IP > IP Addresses. Then, test if something is blocking this connection; on your IIS in PowerShell:
Test-NetConnection -ComputerName sqlservername -Port 1433
If this doesn't work, check the Inbound Rules for Windows Firewall on your SQL Server. Make sure you work on the right network profile and eventually speak to the one managing your network systems in your company.
Maybe your IIS can't resolve the SQL Servers hostname? Try using the IP and check your DNS configuration.
There might also be something off with your connection string. Mind posting it here?

Connect to SQL Server 2016 via Putty/SSH

I have an SSH tunnel established to my Server using Putty. I have set up two tunnels:
L3407 => 192.168.100.107:3389
L31433 => 192.168.100.107:1433
I can successfully RDP into the server using "localhost:3407". However, when I open SSMS and try using "localhost,31433" it won't connect. The error I get reads:
"A network-realted or instance-speciffic error occured while establishing a connection to SQL Server. The server was not found or was not accessible. Verify the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - The remote computer refused the network connection.) (Microsoft SQL Server, Error: 1225)"
I've verified that TCP/IP is turned on in SQL Server Configuration Manager, and the IP addresses are setup. I have checked the logs on the SQL Server, and I have:
- Server is listening on [127.0.0.1 <ipv4> 1434]
- Server is listening on [::1 <ipv6> 1434]
- Server is listening on ['any' <ipv4> 1433]
- Server is listening on ['any' <ipv6> 1433]
I can connect to SSMS on the server using the machine name (named pipes),(LOCAL), localhost, 192.168.100.107, or the public IP. And if I open a hole in the Firewall for port 1433, then I can connect locally using ":1433". (Of course I almost immediately start seeing hacking attempts, so it has to be turned right back off.)
Based on the error I would think that the server is blocking it somehow, but the local Firewall is off and the hardware Firewall logs no attempts for RDP or SSMS (as expected, since it is going through the tunnel).
I am lost on what else to try. Anyone have any ideas?

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?
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.
You may be able to ping the server if the machine is turned on, but in order to connect to the SQL server instance, you should make sure that the SQL server is up and running on the server machine. Check this link for more details
How to Start, stop or restart SQL Server Instance

Cannot connect to SQL Server From Clients in LAN

Yesterday I had no problems. Now when any client (even MSSMS from a client machine) tries to access sql server located on a server in the domain I get the following error: TITLE: Connect to Server
Cannot connect to SERVER\Instance
A network-related or instance-specific error occurred while establishing a connection to SQL Server. ...
SQL server is 2014 on a Windows 2012 R2 Server which also hosts the Active Directory.
I can connect using MSSMS from the server itself to the database. The log states that the service started and is listening on port 63782. I can also connect to sql server from the host machine using ip:port (192.168.0.2, 63782). But I cannot connect to it this way from the clients. (I made no changes to the firewall and the rule for lan-lan is allow all services and all connections).
Shared Memory, TCP/IP and Named Pipes are enabled on the sql server configuration Manager.
I can ping to the server from the clients and to the clients from the server.
The main difference between yesterday and today is that I had to reinstall the DNS on the server. The DNS appears to be working very well and I can't find any DNS errors on the server. I don't think its the firewall but I added two rules that allow UDP and TCP specifically within the local network (even though there is a policy which allows all traffic within the local network).
I am at a loss and would appreciate some assistance into solving the problem or even where to look.

Unable to connect to SQL Server on VPS remotely

I have a VPS, installed SQL Server and everything but the problem is that I can't access the database from outside my VPS.
I tried the following:
Enable port 1433 in firewall
Enable windows and server authentication in SQL Server
Enable TCP/IP
Make sure that SQL Browser is Running
When I connect using SQL Server authentication inside my VPS, it works fine, but from my PC 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) (Microsoft SQL Server, Error: -1)
Now what should I do?
Most probably, your MS SQL server is not configured for Remote Access. Try following:
1) Open SQL Server Configuration Manager.
2) Click on Protocols for SQLEXPRESS from left hand side pane, from right hand side pane, double click on TCP/IP.This will open TCP/IP properties.
3) Under TCP/IP properties page, enter public IP address of SQL server under IP address field. Enter port number 1433 under port TCP port field.
4) Click on Apply and OK.
5) Restart the MS SQL Service.
6) Connect to MS SQL Server through SQL Server Management Studio as follows:
My response might be old though. Say you are still experiencing the same issue,
Ensure that Protocol is set to Yes
Then restart SQL Server and you
should be fine.

Resources