Named pipes error when connecting to remote Express Edition server - sql-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.

Related

SQL Server port forwarding

I forwarded port 1433 to 9082 on my server, at firewall set to allow for inbound and outbound, at SQL Server Allow Remote is ON.
But, I can't connect to my SQL Server from client.
I installed SQL Server 2012.
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: 25 - Connection string is not valid)
Solution to problems connecting to MS SQL server with Microsoft SQL Server Management Studio if your port is forwarded
I had problem with this as well. It's been bugging me for days now. Finally I stumbled on solution on this page so I'll exclude it as screenshot:
It's not : like in all other systems, you have to put ,
First off check in the ERRORLOG the port used by SQL Server (there is no guarantee it will always listen on 1433, or if TCP is enabled at all).
In the ERRORLOG, at startup, you will find a line like this one:
In my case the port is indeed 1433 but yours may be different. If needed, you can change it using the SQL Server Configuration Manager.
Secondly, if you are forwarding a port to a different one (like your example from 1433 to 9082) you are in fact disabling the SQL Server Browser. This happens because SQL Server Browser does not know of your port forward so it will tell the clients to connect to 1433 (supposing you are allowing UDP 1434 otherwise you won't be able to reach SQL Server Browser at all).
You can connect to a SQL Instance without using the SQL Server Browser though, all you need is to specify the port in the connection string (without the instance name, if any).
For example, if your instance is called MYSERVER/INST your connection string will be something like:
User ID=*****;Password=*****;server=tcp:MYSERVER,9082
Also make sure to configure your SPNs manually otherwise Kerberos won't work.
You can find more details on how to compose the right connection string here: SqlConnection.ConnectionString Property.
try config your router first. after all connect. Btw, already enable TCP/IP #sql yet or not?make sure open port for sql.
check on sql configuration enable or not for open connection
check firewall open or not
check router open or not
check connection lag or not(if network). local no need
make sure sql browser and agent run(for xp if not xp just enable sql browser)
if not all there maybe you wrong installation. if for network work install local/system. not network(this for attach #server cluster)

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.

SQL Server Express : how to allow remote connections

I am trying to allow remote connections for SQL Server Express. When I connect from machine A to connect to SQL Server on machine B using Visual Studio, I get an 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
I followed the following steps below which did not help.
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.
In fact I tried by turning off firewalls entirely but no luck. Any suggestions ?
You need to open the SQL Server Configuration Manager and enable TCP/IP. This is not enabled by default. Port 1433 will need to be open for remote connections.
SQL Server Configuration Manager
SQL Server Network Configuration
Protocols for $InstanceName
Right hand pane select TCP/IP and enable

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)

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