无法连接位于同一网络中另一台PC上的sql server数据库 [英] can't connect my sql server database which located on another pc in same network

查看:163
本文介绍了无法连接位于同一网络中另一台PC上的sql server数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助,

i无法连接我位于同一网络中另一台电脑上的sql server数据库

i在这个问题上阅读更多主题但没有成功我:(

服务器类型:数据库引擎。

服务器名称:192.168.1.2\SQLEXPRESS或mypcname \SQLEXPRESS

身份验证:SQL SERVER身份验证

用户名:sa

密码:*********



错误是:



a建立与sql server的连接时发生网络相关或实例特定错误,验证实例名称是否正确以及sql server是否配置为允许远程连接



请阅读以下步骤:

1-数据库在服务器上工作正常,我用sa连接用户没有问题(来自服务器机器)



2-我启用远程连接并标记为:启用本地和远程连接,在服务中rea配置



3-在服务器机器上我完全关闭防火墙。



4- i确保在sqlexpress协议中启用TCP和共享内存

是否有任何我想念的步骤?

i need help please ,
i can't connect my sql server database which located on another pc in same network
i read more topics in this issue but nothing success with me :(
server type : database engine .
servername : 192.168.1.2\SQLEXPRESS OR mypcname\SQLEXPRESS
Authentication : SQL SERVER Authentication
username : sa
password : *********

error is :

a network related or instance specific error occurred while establishing a connection to sql server ,verify the instance name is correct and that sql server is configured to allow remote connections

please read below steps that i do :
1- database worked fine on the server and i connect it using sa user with no problem (from server machine )

2- i enable remote connection and marked on : enable local and remote connection which in service area configuration

3- in the server machine i turn the firewall off totally .

4- i make sure that both TCP and shared memory are enabled in sqlexpress protocol
is there any step i miss ??

推荐答案

如果您正在使用您的app.config(或web.config)中的ADO.NET连接字符串应该类似下一个:

If you are using ADO.NET in your app.config (or web.config) you connection string should be something like the next one:
<setting name="ConnectionStrings" serializeas="String">
        <value>server=192.168.1.2;database=YourDBName;user=sa;password=xxxxx;</value>        
 </setting>





有关SQL Server连接字符串的更多信息,请此处! [ ^ ]



然后通过使用MS SQL Server Management Studio,在服务器属性中 - >连接页面你必须选中允许远程连接到这个服务器选项,并且应该工作!



More info about SQL Server connection strings are here![^]

Then by using MS SQL Server Management Studio, in the "Server Properties" -> Connections page you have to check "Allow remote connection to this server" option, and should work!


这篇关于无法连接位于同一网络中另一台PC上的sql server数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆