Remote login to SQL Server Express 2008 - sql-server

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.

Related

Connect to SQL Server from another computer - SQL network-instance related issue (with error 258)

When I try to connect to SQL database from another computer using SQL Server Management Studio with Server Name [ my_ip_address,1433\MyServerName ] and SQL authentication, I get this error:
Cannot connect to XX.XXX.XXX.XXX,1433\MyServerName.
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: TCP Provider, error: 0 - The wait operation timed out.) (Microsoft SQL Server, Error: 258)
The wait operation timed out
I have done all of the needed steps:
Allowed remote connection in Server Properties window in SQL Management Studio
Enabled TCP/IP in SQL Configuration Manager (in SQL Server Network Configuration)
Set Inbound/Outbound enable connection (Domain, public, private) rules in Windows Firewall for ports
TCP 1433
This tuto solved the problem for me:
Allow SQL Server through Windows Firewall (
https://www.youtube.com/watch?v=3jVTUll4PXs)
I had to add the paths of the sql server and sql server browser services to the allowed apps by the firewall.

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.

Could not connect to SQL Server instance from one of the machines

I have two machines (a laptop and a desktop) connected to the same network throgh the same router and an SQL Server with 2 instances: ODD and EVEN, both instances have the same configuration (as far as I can see), including sa account settings.
From my desktop I can connect to both instances, but from laptop I can connect only to the EVEN instance, when I try to connect to ODD instance I get the following error:
Microsoft Visual Studio
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)
OK
I know that:
I have correct password, because I can connect to EVEN
I have correct firewall settings, because I can connect to EVEN and both instances use the same TCP/IP port 1433
I have properly configures server, because I can connect to the both instances from desktop.
How should I troubleshoot this issue? Is there any more detailed information about what went wrong? Why does Visual Studio uses named pipes and does not try TCP/IP for example?
Check Sql Server Configuration manager on your client and server to see if TCP/IP protocol is enable or not. you can even disable Named Pipes protocol there and see how it will effect on VS error message.
you can even check server setting by trying below command from command shell.
telnet server-ip 1433

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.

Cannot connect to sql server

I cannot connect to Sql server remotely from management studio , It is corrrect User name and password, but
how to enable remote connections to a sql server?
what is other chances?
Cannot connect to xxxx.xxxx.xxxx.xxxx
===================================
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)
thanks
Check out surface area configuration. It gives options to do so.
Edit: Enable the Named pipes conenction as well. I guess you are using Named pipe to connect. Also check if the SQL server browser service is running on the DB server.
Check the Authentication mode settings. It may be set to Windows Authentication only, it needs to be in Mixed Mode to accept SQL usernames & passwords.
Also check the Server network configuration and make sure named pipes or tcp/ip are enabled add that the client is using the appropriate protocol.
If everythings are correct, you may want to connect with a upper version, for example you are in SQL Server 2005 and want to connect to SQL Server 2008.
Note that you cannot connect to a upper version.(only same version or older version are granted)

Resources