SQL Server 2005 Remote Connection ( Over Internet ) - sql-server

I have installed SQL Server 2005 in mixed mode.
I am able to connect to Database "locally" i.e.
(Server-name/Instance or internal-ip/Instance) using both kinds of Authentication.
I have configured SQL Server for remote connection by following below steps
Steps:
Enable remote connections on the instance of SQL Server that you want to connect to from a remote computer.
Turn on the SQL Server Browser service.
Configure the firewall to allow network traffic that is related to SQL Server and to the SQL Server Browser service. Ref: http://support.microsoft.com/kb/914277#method3
In addition, I have turned off my firewall.
I am able to ping my computer through the External IP.
But when it comes to connecting to sql server, its giving the error.
"TITLE: Connect to Server
Cannot connect to <ip address>\SQLEXPRESS.
ADDITIONAL INFORMATION:
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)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=-1&LinkId=20476
Please help me,
I have referred many article and tested all possible solution, but nothing seems to be working for me.

It turned out to be an issue with Port Forwarding from my Modem/Router to respective Machine IP.
To resolve this issue, I just configured my Router so that it can accept the request on some specific port [External IP:port_number] and then map that request to my machine's [Internal IP:port_number] as multiple computers were connected to a single router.
Also, please make sure that Firewall on your server is configured correctly to accept the inbound network traffic on that specific port.

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?

Cannot connect to local SQL Server database from a different computer

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 Specific) (Microsoft SQL Server)
I am trying to allow remote access to my local SQL Server database when the user is using my application on a different computer. I've been trying different approaches for weeks and nothing seems to work.
Here is a list of things that I have tried to do:
Changed server property settings to Allow remote connections to the server
Enable TCP/IP and listed 1433 port number in IPALL field
Created inbound rule for SQL Server program, SQL Browser, and port 1433
Temporarily disabled Windows firewall
Again, I know there is a lot of information surrounding this issue, but I feel like I've implemented every solution I could find and nothing is working.
Thank you in advance for your help!
Regarding #1, the allow remote connections to this server checkbox in SSMS does not actually allow remote client clients to connect despite the misleading name. Use SQL Server Configuration Manager (e.g. C:\Windows\SysWOW64\SQLServerManager15.msc, depending on your SQL version) instead. Right-click on SQL Server Network Configuration-->Protocols-->TCP/IP, select Enable, and restart the SQL Server service.

Connecting to Azure DB from SQL management studio is failing MSSQLSERVER_10060

I'm trying to connect to the sql server that has been created on Azure using SQL management studio, but i'm getting the following error.
Error message: An error has occurred while establishing a connection to the server. When connecting to SQL Server, 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 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) (Microsoft SQL Server, Error: 10060)
I have enabled the client IP in the SQL server firewall settings.
Please let me know if anything else need to be taken cared. Thank you
To resolve this error, try one of the following actions:
Make sure that you have configured the firewall on the computer to allow this instance of SQL Server to accept connections. That is, If you are trying to connect from within a corporate network, outbound traffic over port 1433 may not be allowed by your network's firewall. If so, you cannot connect to your Azure SQL Database server unless your IT department opens port 1433. On the Azure Side, you also need to check if the NSG (associated with that subnet the Azure SQL server sitting in) allows the client IP with the specific port 1433.
Add the client IP in the SQL server firewall settings if you enable a server-level firewall.
Telnet the current IP of your Azure SQL Database server with the port to verify the network connection.
Ensure the server name you are connecting to is correct.
Check that your own firewall allows your connection across the internet to the instance.
Typically if it was the Azure firewall side, it would prompt you to add your IP to the firewall rules, provided you're connecting with an admin account.
This cause by network restriction in your lan. you can try by switching your network connnection. It worked for me.

Named pipes error when connecting to remote Express Edition server

I am trying to connect to MS SQL Server 2008 R2 Express Edition through a Remote computer.
I am getting 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: Named
Pipes Provider, error: 40 - Could not open a connection to SQL Server)
On running SELECT CONVERT(char(20), SERVERPROPERTY('InstanceName')) instancenameting
I get NULL as the instance name. I have started SQL Browser service, checked TCP/IP are enabled.
What else can be done?
Use
Data Source=IP-0A6E3175;Network=DBMSSOCN;...
Or
Data Source=<<ip address>>;Network=DBMSSOCN;...
You'll also need to make sure that TCP/IP is enabled on the host using SQL Server Configuration Manager, that you aren't blocked by a firewall, etc.
And just for kicks, also please try:
Data Source=<<ip address>>\SQLEXPRESS;Network=DBMSSOCN;...
In addition to Aaron's suggestion to ensure your connection string uses tcp, run SQL Server Configuration manager and check the following:
do you have more than one instance?
tcp/ip enabled?
if the instance you are targeting is not the default instance, it will not be on port 1433 but rather some dynamic port. The Microsoft libraries figure out which port using SQL Server Browser on port 1434. Your firewall needs to allow that also (UDP).
if your Express instance is the only instance, you can change to use port 1433. Then you don't need SQL Server Browser.

Remote login to SQL Server Express 2008

I am remotely accessing SQL Server Express 2008.
I have turned on service "SQL Server Browser"
I have turned on service "SQL Server (SQLExpress)"
I have enabled TCP/IP and set dynamic ports to blank and tcp port to 1433 in properties
I can connect localy(using ip) so my credentials are correct.
I have a exceptions record in my windows firewall setting port 1433 as open.
I have performed a system reboot making all services are still turned on.
After i try and connect via a remote computer I get this error.
Cannot connect to XXX.XXX.XXX.XX
===================================
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) (.Net SqlClient Data Provider)
------------------------------
Error Number: 3
Severity: 20
State: 0
your ideas and solutions will be greatly appreciated.
KJ
Edit
Hi and thanks for the quick responses. At present there is no connection string. I am trying to connect using: SQL Server Management Studio 2008
Edit 2
Hey Nick.
I am connecting using SERVERNAME\SQLEXPRESS I turned off windows firewall off and still there was no joy.
I tried adding the port like you suggested:
===================================
Cannot connect to XXX.XXX.XXX.XX, 1433.
===================================
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: TCP `Provider, error: 0 - No connection could be made because the target machine actively refused it.) (.Net SqlClient Data Provider)`
please show us the connection string in you are using to connect to the server with.
If your connecting using the instance name. eg. SERVERNAME\SQLEXPRESS then you will need to open up your firewall for the SQL Browser service i.e. UDP port 1434.
Alternatively, try using the port in your connection string and forget the instance name. Eg. in SSMS you can connect using SERVERNAME,1433 where 1433 is the port you've specified sql server listens to.
You say you have configured TCP/IP but your connection error message says this:
provider: Named Pipes Provider
Update
It appears you have one protocol enabled on Sql Express and are trying to connect with another via Sql management Studio. You need to connect with the TCP provider or enable Named Pipes on your Sql Server Express Configuration.
To connect with TCP, in Sql Management Studio click the Options button on the login page. This will take you to a Connection Properties page where you can select the provider. The Network protocol is probably set to default or Named Pipes at the moment and it needs to be changed to TCP.
Alternatively, in Sql Server Configuration Manager, enable Named Pipes in Protocols for Sql Express.

Resources