How to enable remote connections in SQL Server 2008?
2014-04-04 15:07
656 查看
You experience the following error message:
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)
![](http://blogs.msdn.com/blogfiles/walzenbach/WindowsLiveWriter/HowtoenableremoteconnectionsinSQLServer2_DB3D/SQLServer2008_TestResults%5B1%5D_thumb.png)
How to solve this issue?
There are a couple of things that might be going on here… (All of the following configurations are made on the computer running your SQL Server 2008 instance)
Allow remote connections to this server
The first thing you want to check is if Remote Connections are enabled on your SQL Server database. In SQL Server 2008 you do this by opening
SQL Server 2008 Management Studio, connect to the server in question, right click the server…
![](https://oscdn.geek-share.com/Uploads/Images/Content/201909/20/22ffcc5206e84bda18983cf1f1994620.png)
… and open the Server Properties.
![](https://oscdn.geek-share.com/Uploads/Images/Content/201909/20/46febe70bc1170b07dd8dbb314b0a136.png)
Navigate to Connections and ensure that Allow remote connections to this server is checked. Check if this solves the problem. If it does, here you go, continue with whatever you were doing and have a nice day.
Protocols for MSSQLServer
If you’re still running in issues let’s dig a bit deeper. The next good thing to check is the
SQL Server Network Configuration. Open the SQL Server Configuration Manager, unfold the node
SQL Server Network Configuration and select Protocols for MSSQLServer (or whatever the name of your SQL Server instance is).
![](https://oscdn.geek-share.com/Uploads/Images/Content/201909/20/6c2d12ad8f1e85d38fac9b8d22ae8a81.png)
Make sure that TCP/IP is enabled and try again. Even though I hope that this resolved your problems there might still be an issue with…
The Firewall
If there is still no communication happening between your computer and the remote SQL Server you most likely need to configure your firewall settings. A good first step is to figure out which port is being used by TCP/IP (and which you need to open in your
firewall). You can do this by right clicking TCP/IP and selecting Properties.
![](https://oscdn.geek-share.com/Uploads/Images/Content/201909/20/a3c9274f336cd6f9fea00808094fde0e.png)
Click on the tab IP Addresses and voilà – Port 1433 it is :-) That was easy enough and all there is left to do is to allow inbound TCP/IP traffic on Port 1433 in your firewall. In Windows 7 this works something like this. Open the
Control Panel and navigate to Windows Firewall.
![](https://oscdn.geek-share.com/Uploads/Images/Content/201909/20/1eb3e4de7e15666e0517c9e1e70c635c.png)
Click on Advanced Settings on the left hand side and you should see the
Windows Firewall with Advanced Security. Select the Inboud Rules on the left hand side and click on
New Rule… on the right hand side.
![](https://oscdn.geek-share.com/Uploads/Images/Content/201909/20/54162bb6b58d73b13292abfe51fdc846.png)
This opens the New Inbound Rule Wizard which you can use to allow
inbound traffic on Port 1433 for TCP/IP (and which is exactly how you configured your SQL Server in the steps above). Just follow the steps outlined below and you should be good :-)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201909/20/4876d21bba67e55ce434f9402f9b2542.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201909/20/e76763e3cf2d410f5350d756609f27ed.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201909/20/2feb37e8fe7eec59ff355c553719bf1a.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201909/20/aa41f8a3d247dd653ee2a42ec3afe73e.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201909/20/dc0e2236785c226288921bbb19cb4ebe.png)
That’s it, success! From here you should be able to access your SQL Server remotely. Enjoy!
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)
![](http://blogs.msdn.com/blogfiles/walzenbach/WindowsLiveWriter/HowtoenableremoteconnectionsinSQLServer2_DB3D/SQLServer2008_TestResults%5B1%5D_thumb.png)
How to solve this issue?
There are a couple of things that might be going on here… (All of the following configurations are made on the computer running your SQL Server 2008 instance)
Allow remote connections to this server
The first thing you want to check is if Remote Connections are enabled on your SQL Server database. In SQL Server 2008 you do this by opening
SQL Server 2008 Management Studio, connect to the server in question, right click the server…
![](https://oscdn.geek-share.com/Uploads/Images/Content/201909/20/22ffcc5206e84bda18983cf1f1994620.png)
… and open the Server Properties.
![](https://oscdn.geek-share.com/Uploads/Images/Content/201909/20/46febe70bc1170b07dd8dbb314b0a136.png)
Navigate to Connections and ensure that Allow remote connections to this server is checked. Check if this solves the problem. If it does, here you go, continue with whatever you were doing and have a nice day.
Protocols for MSSQLServer
If you’re still running in issues let’s dig a bit deeper. The next good thing to check is the
SQL Server Network Configuration. Open the SQL Server Configuration Manager, unfold the node
SQL Server Network Configuration and select Protocols for MSSQLServer (or whatever the name of your SQL Server instance is).
![](https://oscdn.geek-share.com/Uploads/Images/Content/201909/20/6c2d12ad8f1e85d38fac9b8d22ae8a81.png)
Make sure that TCP/IP is enabled and try again. Even though I hope that this resolved your problems there might still be an issue with…
The Firewall
If there is still no communication happening between your computer and the remote SQL Server you most likely need to configure your firewall settings. A good first step is to figure out which port is being used by TCP/IP (and which you need to open in your
firewall). You can do this by right clicking TCP/IP and selecting Properties.
![](https://oscdn.geek-share.com/Uploads/Images/Content/201909/20/a3c9274f336cd6f9fea00808094fde0e.png)
Click on the tab IP Addresses and voilà – Port 1433 it is :-) That was easy enough and all there is left to do is to allow inbound TCP/IP traffic on Port 1433 in your firewall. In Windows 7 this works something like this. Open the
Control Panel and navigate to Windows Firewall.
![](https://oscdn.geek-share.com/Uploads/Images/Content/201909/20/1eb3e4de7e15666e0517c9e1e70c635c.png)
Click on Advanced Settings on the left hand side and you should see the
Windows Firewall with Advanced Security. Select the Inboud Rules on the left hand side and click on
New Rule… on the right hand side.
![](https://oscdn.geek-share.com/Uploads/Images/Content/201909/20/54162bb6b58d73b13292abfe51fdc846.png)
This opens the New Inbound Rule Wizard which you can use to allow
inbound traffic on Port 1433 for TCP/IP (and which is exactly how you configured your SQL Server in the steps above). Just follow the steps outlined below and you should be good :-)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201909/20/4876d21bba67e55ce434f9402f9b2542.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201909/20/e76763e3cf2d410f5350d756609f27ed.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201909/20/2feb37e8fe7eec59ff355c553719bf1a.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201909/20/aa41f8a3d247dd653ee2a42ec3afe73e.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201909/20/dc0e2236785c226288921bbb19cb4ebe.png)
That’s it, success! From here you should be able to access your SQL Server remotely. Enjoy!
相关文章推荐
- mysql基础入门篇——SQL基础
- SQLSERVER索引
- SQL SERVER 如何调试存储过程
- 看懂SqlServer查询计划
- oracle分页查询数据重复问题的解决
- sql 列转行
- SQL 收缩数据库
- 使用memcache(thinkphp框架学习)
- SQL语句实现不存在即插入,存在则increase某字段的功能insert into … on duplicate key update
- mysql关联更新表
- mysql如何设置主键和外键,实现级联更新、级联删除
- MySQL 添加约束,修改约束,删除约束
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual...
- MySQL管理之数据备份及恢复
- MySQL管理之数据备份及恢复 推荐
- 群发“站内信”根据不同用户量,不同的数据库设计原理
- ORACLE大表删除部分数据的最佳方案
- 被PL/SQL developer坑了
- SQL 模糊查询
- 关于MongoDB的group用法