SQL Server 2005 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) ”
Things to check:
1. Make sure your database engine is configured to accept remote connections
• Start > All Programs > SQL Server 2005 > Configuration Tools > SQL Server Surface Area Configuration
• Click on Surface Area Configuration for Services and Connections
• Select the instance that is having a problem > Database Engine > Remote Connections
• Enable local and remote connections
• Restart instance
2. Check the SQL Server service account
• If you are not using a domain account as a service account (for example if you are using NETWORK SERVICE), you may want to switch this first before proceeding
3. If you are using a named SQL Server instance, make sure you are using that instance name in your connection strings in your ASweb P.NET application
• Usually the format needed to specify the database server is machinenameinstancename
• Check your connection string as well
<connectionStrings>
<add name=”SampleConnectionString” connectionString=”Data Source=machinenameinstancename;Initial Catalog=AdventureWorks;Integrated Security=SSPI;Min Pool Size=5;Max Pool Size=60;Connect Timeout=30″ providerName=”System.Data.SqlClient”/>
</connectionStrings>
4.You may need to create an exception on the firewall for the SQL Server instance and port you are using
• Start > Run > Firewall.cpl
• Click on exceptions tab
• Add the sqlservr.exe (typically located in C:Program Files (x86)Microsoft SQL ServerMSSQL.xMSSQLBinn), and port (default is 1433)
• Check your connection string as well
5. If you are using a named SQL Server instance, make sure you are using that instance name in your connection strings
6. Check SQLBrowser; check that it is running. You may also need to create an exception in your firewall for SQLBrowser.
7. Check that you have connectivity to the SQL Server. Note what you are using to connect: machine name, domain name or IP address? Use this when checking connectivity. For example if you are using myserver
• Start > Run > cmd
•netstat -ano| findstr 1433
•telnet myserver 1433
•ping -a myserver
Check what ports are IP addresses are being returned.
Alternative:
If you still can’t get any connection, you may want to create a SQL account on the server, a corresponding SQL user on the database in question, and just use this username/password combo in your web application.
Thank you very much this solved my issue immediately.
Excellent answer. I’ve struggled with this for many weeks. Thanks again.
By the way, I could connect to my default instances from a client machine, but could not connect to a named instants. I appied same setting to second instance. anything went wrong?
Robin
hello!
I am using sql server 2008 and visual studio 2010. while making connection b/w these two an exception is fired in my program…
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)
please help me
with regards
salil
My problem was resolved real quick. It was # 1.Thanks for arranging info. so Clear and clean. Great
Hi,
I have tried all options which have been stated here and some other websites but still i have the same error
Thanks in advance
#1 hit the mark!
Unreserved thanks – but WHY don’t I remember using the “Surface Area Config” utility before ?
Is there another way to allow remote access (express 2005)
that I must have forgotten ?
This is my 3rd instance to create on the server and the previous 2 DID allow remote access initial but I was stumped on sql3rd instance. Go figure !
R
Thanks for this post Belle. This post is the most comprehensive one for this error. Thanks again
Thank You……Start all Services in Start > All Programs > SQL Server 2005 > Configuration Tools > SQL Server Surface Area Configuration
Great post.
Just thought you might like to see someone who has scraped your work and passed it off as their own. Scumbags.
http://sqlservererror-info.blogspot.com/2010/09/network-related-or-instance-specific.html
Thanks Andy. Not sure what to do with the plagiarism. All I can do is to ask them to take those pages down. I saw another site that had a handful of my articles! Ironically they also passed off that they “also” work at Black Ninja …
Great post, the firewall exception was what I needed
Cheers,
SteveC.
#6 was my problem, also. Thanks so much for this post!
Same issue here, had DPM 2007 with sql 2005, upgraded to dpm 2010 and sql 2008. Ran a repair on sql 2008 shared components and error resolved.
Nothing is working, Ive tried to completly disable every firewall on my machine including the antivirus, every step you said. I cannot connect to my sql express.
I have it insatlled on my devellopement machine and I try to connect via the local network. It detects the server when I browse it but cant connect.
pls somebody help me i cannot instal sqlserver 2005 coz it cannot find the ipaddress. cannot connect to remote connection. i dunno whats lacking….
I believe
• Enable local and remote connections
was my answer.
Thanks you for great help.
Only Restart Server and login again…
THANK YOU Sir! It helps me VERY MUCH!!! Helpful, very Helpful INDEED! =)
Many thinks, number 3 got me.
Great post, the firewall exception was what I needed
Thanks a lot, that saved me stressing out about not being able to do my assignment.
Hi
I am having the problem to connect to SQL Server. I have developed an application in VB.Net one client computer where it is running. But on the other client it could not connect to Sql Server.
Fire wall is disabled on client. But enabled on server.
any one help me.
I was having the same issue with SQL 2005 Express on Windows 7. Issue was resolved by adding UDP port 1434 (SQL Browser) to my inbound and outbound firewall rules.
Thank you it helped me identify the problem. sqlservice was stopping.
Girum
In the SQL server configuration manager, there is an item called SQL server network configuration, under protocols, I selected the properties of the TCP/IP protocol. There is a tab “IP Addresses” there, and at the bottom of the list is an entry called IPAll. In my case the TCP port was empty. I entered the SQL standard port 1433 in there and I was able to connect.
This should work!
Hi. I had trouble with number 4. I assumed that once you have disabled the firewall, everything should work fine. Unknown to me, everyone will notice that in windows 7 and server 2008R2, disabling firewall does not stop the machine from blocking programs not on the allowed list.
Great help.. thanks.
awesome big clap!!!
thx a lot
Please help to me it is error how is it solove.
SQL Server 2005 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) ”
75.Mohammed Mudassir – Sir you are my hero! I’ve tried all those steps mentioned none of it work except your method. I was able to connect remotely to my sql 2008 server withouth any error from other apps that connect to my sql 2008 server with no problem but for some reason why i try to connect to it from my system center service mananger server it doesn’t work but your suggestion is what makes it work. I’ve been working on this for over three days. Btw Iam not a dba guy, just starting to managing our sql environment.
I need to create a SQL Server 2008 Database programatically. And then add three tables in that database. And for connecting to sql server i need to use SQL Data client. I am unable to create a SQL Server Database programatically. Everyone it is showing how to create tables in a existing database. Please help!!
Thanks a lot in advance.
Apart from this, when migrating from development environment to another it can be simply that this error occurs due to the presence of incorrect connection string. I recommend going through all items that make use of connection strings. This is where programming best practices are best used. Basically “Use only one connection string”.
GO START -> ALL PROGRAMS -> SQL SERVER 2008/2005/2008 R2
->CONFIGURATION TOOLS->
->SELECT SQL SERVER CONFIGURATION MANAGER
->SELECT SQL SERVER NETWORK CONFIGURATION
->SELECT PROTOCOLS FOR MSSQLSERVER(YOUR INSTANT NAME)
->IN RIGHT TASK PANEL
->MAKE SURE MENTION BELOW:
DISABLE SHARED MEMORY AND VIA
ENABLE NAMED PIPE AND TCP/IP
—-MAKE SAME THING IN
->SQL NATIVE CLIENT 10.0(SERVER VERSION) CONFIGURATION – CLIENT PROTOCOLS
RESTART SQL SERVER(MSSQLSERVER [YOUR INSTANT NAME]) SERVICE
Hi
Can You Please help me? I get following error after Upgrading
SQL Server 2008 to SP2 , Unable to connect to SQL Server Named Insatnce after using SSMS . The Network Service Stops when I try to connect using SSMS
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.) (Microsoft SQL Server, Error: 10061)
Thanks for your help
Regards
Dave
Check the SQL services (Start -> Settings -> Control Panel -> Administrative Tools -> Services) and switch all “Disabled” services to “Automatic”
I hope this help you.
I get the same error msg after adding a login form in Microsoft Visual Studio 2008 but with SQL Server 2008. Confusing, there is somewhere it says “SQLExpress database file auto-creation error: ” while I don’t use Express version, I use Enteprise version. How can I solve this?
Wow Excellent Explanation.
Hi and tanx for your good recommendations!
Could you update this topic for sql server 2008 and windows7?
Thank you, it helped me connect to my SQL server
[…] to check: Resolving “A network-related or instance-specific error occurred while establishing a connecti… __________________ Florin Aparaschivei Iasi, […]
I was getting numerous errors on my SharePoint farm after migrating to a new SQL 2008 R2 cluster (running on Windows 2008 R2). After about a month of troubleshooting, I decided to update my network card drivers on the new SQL cluster (Broadcom II). This fixed all the SQL “network-related” errors for me.
Issue with the connection to SQLExpress
This is the connectin string that I have given
SqlConnection myConnection = new SqlConnection(“Server=GINOJVISWAM/SQLEXPRESS;AttachDbFileName=D:/DotNet-Studies/SQLServer/WebSiteCheck/App_Data/PUBS.mdf;Database=PUBS;Trusted_Connection=False;”);
myConnection.Open();.
Is there any issue with the string. Any help would be appreciated.
when i am trying to send data into another computer sql server 2005 using windows forms application in .net ‘it shows error message “Login Failed fpr DEEPAK/guest” . please help me i am in trouble , please help me………
hi
great post
http://csharpektroncmssql.blogspot.in/2012/04/network-related-or-instance-specific.html
[…] syntaxes for e.g. ngmssql or ngmssql,1433 or dac:ngmssql, etc. ———- Ref: http://www.sqlmusings.com/2009/03/11/resolving-a-network-related-or-instance-specific-error-occurred… 1. Make sure your database engine is configured to accept remote connections • Start > All […]
Hi,
Background:
SQLExpress 2012, Visual Studio 2012 running Win 7 Ent 64 bit, App in VB.Net
SQLconnStr = “Server=MYCOMPUTERSQLEXPRESS;Initial Catalog=APPDB;Integrated Security=SSPI”
Both SQLExpress and Visual Studio are running on the same computer.
Problem:
I kept getting SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified whenever I tried to connect to the database.
Troubleshooting:
All network connections are enabled in the Server – named pipe, tcp, and shared memory.
Ran it with Win Firewall turned off – still the problem persist.
Ensure Win Firewall has port 1433 enabled – problem still persist.
Ping server – ok, sqlcmd -L – return the right serverinstance
SQL Management Studio – connects with no problem
Ensure remote connection is enabled on the server
Install the SQLExpress 2012 on another machine running Win 8, ran same App – No problem
Very puzzled, can someone shed some light? Thanks in advance!
writing IP ADDRESSMSSQLSERVER2008 solved my problem
Thanks, it is working..
[…] Resolving A network-related or instance-specific error … – SQL Server 2005 Error: “A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not …… […]
Dear sir,
please solutions 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
use to sql server 2008 r2
thanks
avinash
Thanks a lot!!!!!!
#1 write!
This’s solved my issue immediately..
Clear and awesome reference ever!