How to: Configure Express to accept remote connections
Updated
The information in this posting is superseded by the following KB Article:
914277 How to configure SQL Server 2005 to allow remote connections
https://support.microsoft.com/default.aspx?scid=kb;EN-US;914277
-----------------------------------------------------------------------------------
Some people have been having issues when trying to make remote connections
to SQL Express. This document will hopefully clarify most of the issues
around remote connections.
First, networking protocols are disabled by default in SQL Server Express.
Thus, if someone simply installs Express and chooses all the defaults, SQL
Server Express will only be able to have connections originating on the
local machine where SQL Server is installed.
To enable SQL Server Express to accept remote connections we need to perform
the following steps:
STEP 1: Enabling TCP/IP
First we must tell SQL Server Express to listen on TCP/IP, to do this
perform the following steps:
1. Launch the SQL Server Configuration Manager from the "Microsoft SQL
Server 2005 CTP" Program menu
2. Click on the "Protocols for SQLEXPRESS" node,
3. Right click on "TCP/IP" in the list of Protocols and choose, "Enable"
STEP 2: To Browse or not to Browse
Next, we have to determine if we want the SQL Browser service to be running
or not. The benefit of having this service run is that users connecting
remotely do not have to specify the port in the connection string. Note: It
is a security best practice to not run the SQLBrowser service as it reduces
the attack surface area by eliminating the need to listen on an udp port.
OPTION A: If you want to always specify a TCP port when connecting (Not
using SQL Browser service) perform the following steps else skip these
steps:
1. Launch the SQL Server Configuration Manager from the "Microsoft SQL
Server 2005 CTP" Program menu
2. Click on the "Protocols for SQLEXPRESS" node
3. Click on the "TCP/IP" child node
4. You will notice an entry on the right panel for "IPAll", right click
on this and select, "Properties"
5. Clear out the value for "TCP Dynamic Ports"
6. Give a TcpPort number to use when making remote connections, for
purposes of this example lets choose, "2301"
At this point you should restart the SQL Server Express service. At this
point you will be able to connect remotely to SQL Express. A way I like to
check the connection is my using SQLCMD from a remote machine and connecting
like this:
SQLCMD -E -S YourServer\SQLEXPRESS,2301
The "," in the server name tells SQCMD it's a port.
So you've tried this and still get an error. Take a look at Step 3, this
should address the remaining issue.
OPTION B: If you want to use SQL Browser service perform these steps:
Note:
You will need to make this registry key change if you are using the April
CTP or earlier versions:
To enable sqlbrowser service to listen on the port 1434, the following
registry key must be set to 1
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90\SQL
Browser\Ssrplistener
Next, restart the sqlbrowser service.
1. Start the SQL Browser Service
STEP 3: Firewall..?
At this point you should be able to remotely connect. If you still
can't chances are you have a firewall configured on the computer where SQL
Express is running. The instructions below are for Windows XP SP2's
firewall settings.
To enable the firewall to allow SQL Server Express traffic:
1. Launch the Windows Firewall configuration tool from the control
panel.
2. Click the Exceptions Tab
3. Click the "Add Programs." button and select "sqlservr.exe" from the
location where you install SQL Server Express
You should be able to remotely connect. Note, you can get more restrictive
by just specifying the port number that will be allowed (used best when
configured with Option A).
Note: If you chose to use the SQL Browser service, you must also add
sqlbrowser service executable to the exception list as it listens on udp
port 1434.
Comments
Anonymous
March 22, 2006
Recently, we answered a lot of customer questions about how to make a successful connection to SQL...Anonymous
July 13, 2006
PingBack from http://munckfish.net/blog/archive/2006/07/13/php-with-sql-server-express-and-windows-2003/Anonymous
July 18, 2006
最近在烦恼,怎么就不能远程访问SQL2005的呢!怎么搞也搞不明白!参考了下面的两个Blog,终于清晰了。http://blogs.msdn.com/sql_protocols/ar...Anonymous
August 17, 2006
Sql server 2005 express, remote connectAnonymous
September 29, 2006
PingBack from http://www.wensline.com/blog/?p=20Anonymous
February 07, 2007
A last recomendation is to add the SQL Browser executable file to the Firewall Exceptions, when you really need to use it.Anonymous
February 08, 2007
PingBack from http://blog.nazin.com/index.php/installing-microsoft-sql-server-2005-jdbc-drivers-for-coldfusion-mx-7/Anonymous
February 08, 2007
PingBack from http://bestlong.no-ip.com/blog/?p=105Anonymous
February 22, 2007
THANK YOU...THANK YOU...THANK YOU! As a newbie to VB and SQ, I wrote a timeclock app for a standalone computer and never had any connection issues to contend with until I had to install my app in a P2P environment with 2 PC's. After lots of Google-ing I landed here and this information put it all into perspective and got me up and running.Anonymous
March 28, 2007
http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277How to configure SQL Server 2005 to allow remote connectionshttp://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspxConfigure Express to accept remote connections http://munckfish.net/blog/archive/2006/07/13/php-with-sql-server-express-and-windows-2003/PHPAnonymous
March 28, 2007
http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277How to configure SQL Server 2005 to allow remote connectionshttp://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspxConfigure Express to accept remote connections http://munckfish.net/blog/archive/2006/07/13/php-with-sql-server-express-and-windows-2003/PHPAnonymous
April 29, 2007
Got a £60 per 1/2 hour personal engineer booked?? CANCEL IT!!! If you like me and many others have rentedAnonymous
May 02, 2007
http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspxAnonymous
May 19, 2007
The comment has been removedAnonymous
May 20, 2007
When you create your DB Dude project and try to build and deploy the project to the client's sandboxAnonymous
July 12, 2007
PingBack from http://www.blackberryforums.com/bes-admin-corner/85610-bb-manager-workstation.html#post599079Anonymous
July 18, 2007
When you create your DB Dude project and try to build and deploy the project to the client's sandboxAnonymous
July 18, 2007
When you create your DB Dude project and try to build and deploy the project to the client's sandboxAnonymous
October 01, 2007
Thanks for Error: 26. I was trying to remote access my sqlexpress from another computer. But, eventually, I found out this blog and my problem was solved. :) Myo.Anonymous
October 18, 2007
PingBack from http://myghillie.info/1969/12/31/sql-server-express-weblog-how-to-configure-express-to-accept-remote-connections/Anonymous
October 18, 2007
PingBack from http://ghillie-suits.info/?p=5586Anonymous
October 30, 2007
PingBack from http://discount-perfume-hq.com/?p=1996Anonymous
October 31, 2007
PingBack from http://discount-perfume-hq.com/?p=2896Anonymous
November 08, 2007
The comment has been removedAnonymous
November 08, 2007
Solution: I was including the port in the ipaddress (192.168.1.1:2301SqlExpress) ... the database name should use the format 192.168.1.1SqlExpress,2301 . For those of us who have never used ports with sql server connections, this should help the learning curve.Anonymous
November 08, 2007
To groker: It's best to post questions to the Forum since it is more targeted for question/answer exchanges. I've not seen this issue where SQLCmd works but Management Studio does not. When posting this question to the forums you should include the entire error message; the first part of the message will likely be the general "remote connections are not enabled" which isn't true in your case, so it's likely that the last part of the message which is in parenthasis will have more useful informaiton. It's also worth reading through the many useful posts about SQL connectivity troubleshooting provided by the SQL Protocols team on thier blog. Here are the posts related to remote connections: http://blogs.msdn.com/sql_protocols/search.aspx?q=remote&p=1 MikeAnonymous
November 14, 2007
PingBack from https://www.mcseboard.de/windows-forum-ms-backoffice-31/sql-express-problem-124731.html#post766723Anonymous
January 15, 2008
PingBack from http://www.etixet.com/sql-server-express-enable-remote.htmlAnonymous
February 25, 2008
Thank you so much. I was trying for the last 2 days to connect from a Remote machine through the VB Application but failed. With your help, my application is a success. Many thanks for your guidance.Anonymous
March 24, 2008
Hello, I followed the steps, but I still get an error: HResult 0x2AF9, Level 16, State 1 TCP Provider: No such host is known Can anyone help me? ThanxAnonymous
March 24, 2008
Response to davidbotero - Please post technical questions to the SQL Express forum on MSDN: http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=385&SiteID=1 MikeAnonymous
May 08, 2008
Configuring SQL Server Express 2005 for Remote Access when SQL Server does not allow remote connectionsAnonymous
May 27, 2008
PingBack from http://zakariarouf.wordpress.com/2008/05/28/configuring-sql-server-express-2005-for-remote-access/Anonymous
July 02, 2008
PingBack from http://luka.adultstoriesdirect.com/sqlserver2005clientconfiguration.htmlAnonymous
November 26, 2008
PingBack from http://sun.mygamesok.com/200811/server-24.htmlAnonymous
November 26, 2008
PingBack from http://digg.mygamesok.com/200811/email-server-3.htmlAnonymous
November 27, 2008
PingBack from http://sun.mygamesok.com/200811/microsoft-sql-server-9.htmlAnonymous
January 20, 2009
PingBack from http://www.hilpers.com/345463-sql-server-2005-sql-authentifizierungAnonymous
January 20, 2009
PingBack from http://www.hilpers-esp.com/403940-preguntas-cortas-variasAnonymous
January 21, 2009
PingBack from http://www.keyongtech.com/45549-upsizing-wizard-from-access-toAnonymous
January 22, 2009
PingBack from http://www.hilpers.fr/920173-acces-a-un-serveur-msdeAnonymous
January 22, 2009
PingBack from http://www.hilpers.it/2534634-firewallAnonymous
February 24, 2009
PingBack from http://mmdmurphy.wordpress.com/2009/02/25/enable-remote-access-of-sql-server/Anonymous
May 29, 2009
PingBack from http://paidsurveyshub.info/story.php?title=sql-server-express-weblog-how-to-configure-express-to-accept-remoteAnonymous
June 06, 2009
PingBack from http://www.pingit.no/?p=312Anonymous
June 15, 2009
PingBack from http://mydebtconsolidator.info/story.php?id=16630Anonymous
June 19, 2009
PingBack from http://edebtsettlementprogram.info/story.php?id=21911Anonymous
June 22, 2009
PingBack from http://blog.maordavid.com/2007/05/sql-server-does-not-allow-remote-connections-error/Anonymous
July 01, 2009
kameralı sesli sohbet girişi - video klip izleAnonymous
July 07, 2009
I am having issues with the Windows XP firewall. I have made the exceptions for sqlsrver.exe and sqlbrowser.exe as well as udp ports 1433 and 1434. The connection works fine as long as the fire wall is turned off. Any ideas?Anonymous
December 23, 2009
Very Good Site Thanks YouAnonymous
December 23, 2009
thanks You !Anonymous
December 23, 2009
Turkiyenin en kaliteli motosiklet sitesi.Anonymous
December 23, 2009
Turkiyenin en kaliteli Rüya Tabir sitesi.Anonymous
June 18, 2010
Thanks! it is an excellent article and helped me alot.Anonymous
October 26, 2010
don't forget you also have to add a firewall rule to SQL Browser or else you would not be able to connect the first timeAnonymous
November 01, 2010
This works support.microsoft.com/.../914277Anonymous
December 09, 2010
I'm on Vista. I have performed the following steps, but a user on my network CANNOT connect to my SQL Server 2008 Express Instance (specifying the port as in your example). I CAN connect to my instance:
- Sql Server Configuration manager: SQL Server network Configuration: a) Enable NP (Named Pipes) b) Enable TCP/IP Properties in TCP/IP: Dynamic Port (removed "0") Set Port to: 2309 (for IP1 through IPall) Restarted SQLExpress for settings to take effect.
- SSMS: a) Set Security, authentication to: SQL Server and Windows Authentication Mode (set sa password). b) Security, Logins: verified the "sa" account was in the list
- Firewall: Added to exception list, leaving the "scope" as the default for testing: a) SqlServer.exe b) SqlBrowser.exe
Anonymous
January 29, 2011
Very nice info. Thank you for your post. www.drwebworks.comAnonymous
January 30, 2011
Thanks..! excellent worked for me after i added windows firewall exception for TCP port 2301.Anonymous
August 01, 2011
The comment has been removedAnonymous
August 27, 2011
If you need to check whether your sql server is accessible online, you can try using the following tool online: www.webkeet.com/sqlservertestconnector.aspxAnonymous
October 17, 2011
What does remote connection refre to.. DOes it mean sharing on sql server database over the LAN or over the internet as well... I have configured SQL server to allow access over the lan (computers connected to a common router can share database with each other).. Now i want to connect it over the internet.. while connecting i used to use ip-192.168.1.109... What will be the ip to connect it over the internet.. Or is that possible??Anonymous
November 17, 2011
Very useful... nice and clean.Anonymous
December 02, 2011
Muchas gracias. Funciona a la perfeccionAnonymous
June 29, 2012
In the 90 folder (HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SQL Server90), i found three items. In reference to option b, should any of these items be changed or any files added. Those three are Default (value not set) SharedCode VerSpecificRootDirAnonymous
August 23, 2012
thaaaaaaaanks so much :D they regkey solved my problemAnonymous
October 15, 2012
it worked like a charm..!! thanks again.Anonymous
January 30, 2013
Very nice info. Thank you for your post. <a href="http://www.cvorneklerim.com">cv örnekleri</a>Anonymous
April 09, 2013
It worked. Thanks very much you saved my day... www.mindarraysystems.comAnonymous
September 03, 2013
Changes to server properties and settings may affect the performance, security, and availability of this SQL Server instance. Before making any such changes, consult the product documentation.Anonymous
November 07, 2013
Very nice article brother it works now in my system (Win 7 & XP). However, i'm trying to use Asp.net webservice using IIS 6.0 in windows 7. I'm able to add web reference but after adding i'm not able to access my database sql express 2005. it says Login Failed: database is read-only. Please help me with this if any one know. i'll be very greatfull to you guys.Anonymous
August 05, 2014
The comment has been removedAnonymous
October 12, 2014
Cannot connect server in sql server 2005 so error is a network-related or instance specific error occured 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:namedpipesprovider error:40 could not open a connection to sql server) microsoft sql server error 2 so plz help meAnonymous
April 08, 2015
Worked for me on SQL Express 2014 and saved a lot of time over talking to the DB guys, thanks!Anonymous
May 22, 2015
Also worth noting that in order to connect with a sql authentication the database settings must be set to allow Sql Server Authentication mode in Database Properties -> Security -> Server Authentication.