本地主机上的SQL Server 2008:连接不断被拒绝

时间:2021-07-27 14:26:28

The problem I am having is that I keep receiving the

我的问题是我一直在接受

(provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)

(提供方:TCP提供方,错误:0 -由于目标机器主动拒绝连接,无法进行连接)

error every time I try to connect to the database.

每次尝试连接数据库时出错。

I can see the database in SQL Server Manager Studio and have created a login for it by right clicking the security folder->new->login and entering a username and password with SQL Server authentication. I can also see the SQLSERVER (SQLSERVERDB) process running in the services window.

我可以在SQL Server Manager Studio中看到这个数据库,并通过右键单击安全文件夹->新->登录,并输入带有SQL Server身份验证的用户名和密码,创建了一个登录。我还可以看到SQLSERVER (SQLSERVERDB)进程在services窗口中运行。

The connection string in my Web.config file is

我的Web中的连接字符串。配置文件是

  <connectionStrings>
     <add name="MainConnString" connectionString="Data Source=MEETING-ROOM\SQLSERVERDB,48006;Initial Catalog=Palace_Live;
          User ID=Palace_Live;Password=p@l@c310!;MultipleActiveResultSets=True;" providerName="System.Data.SqlClient" />
  </connectionStrings>
  • The server name/instance is: MEETING-ROOM\SQLSERVERDB
  • 服务器名/实例是:meetning \SQLSERVERDB
  • The database is called Palace_Live
  • 这个数据库叫做Palace_Live
  • User/Pass is Palace_Live / p@l@c310!
  • 用户/Pass是Palace_Live / p@l@c310!

I know the issue relates to the connection string as if I change the Data Source parameter to say Googl.com I receive a different error message.

我知道这个问题与连接字符串有关,就好像我将数据源参数更改为Googl.com我收到了一个不同的错误消息。

I can't see what steps I have missed or what I am doing wrong. Could anyone help point me in the right direction as to what I might be missing

我看不出我错过了什么步骤,也看不出我做错了什么。有人能帮我指出正确的方向,我可能会错过什么吗

I am using IIS7 and SQL Server 2008 locally on a windows 7 32bit machine.

我在windows 7 32位机上本地使用IIS7和SQL Server 2008。

4 个解决方案

#1


2  

Why are you specifying port 48006?? Is that a change you've made knowing what you're doing?? The default SQL Server port would be 1433.

为什么要指定端口48006?这是你所做的改变吗?默认的SQL Server端口是1433。

If you try to just leave out the non-standard port - does that work for you??

如果你试图忽略非标准端口——这对你有用吗?

Server=MEETING-ROOM\SQLSERVERDB;database=Palace_Live;User ID=Palace_Live;Password=p@l@c310!;MultipleActiveResultSets=True;

#2


2  

As well as creating a Login to SQL Server have you added a User to the database(s) you want to access? This is usually done automatically when you create the Login when you give it access to specified databases, but can be done manually after the fact.

除了创建登录到SQL Server之外,您是否将用户添加到要访问的数据库中?这通常是在您创建登录时自动完成的,当您让它访问指定的数据库时,但是可以在事后手动完成。

#3


1  

Try pinging: MEETING-ROOM\SQLSERVERDB

试试震性:会议室\ SQLSERVERDB

And if it gives you a response use the IP Address directly, also ensure that the Server does not have a firewall rule blocking incoming traffic on Port 48006.

如果它给您一个直接使用IP地址的响应,还要确保服务器没有防火墙规则来阻止端口48006上的传入流量。

Also ensure SQL Server is allowing Windows Authentication and SQL Server authentication. This can be done by right clicking on the database in Management Studio and going to properties and Security.

还要确保SQL Server允许Windows身份验证和SQL Server身份验证。这可以通过在Management Studio中右键单击数据库并进入属性和安全性来实现。

#4


0  

i know the question, the problem is not appear on database, is the IIS7.0. there is a service account ,you need change it network in pool. my english not good,if you also can't slove,please send me email:mjjjj2001@163.com

我知道问题是,问题不在数据库中出现,是IIS7.0。有一个服务帐户,您需要更改池中的it网络。我的英语不太好,如果你也看不懂,请发邮件给我:mjjjjj2001@163.com

#1


2  

Why are you specifying port 48006?? Is that a change you've made knowing what you're doing?? The default SQL Server port would be 1433.

为什么要指定端口48006?这是你所做的改变吗?默认的SQL Server端口是1433。

If you try to just leave out the non-standard port - does that work for you??

如果你试图忽略非标准端口——这对你有用吗?

Server=MEETING-ROOM\SQLSERVERDB;database=Palace_Live;User ID=Palace_Live;Password=p@l@c310!;MultipleActiveResultSets=True;

#2


2  

As well as creating a Login to SQL Server have you added a User to the database(s) you want to access? This is usually done automatically when you create the Login when you give it access to specified databases, but can be done manually after the fact.

除了创建登录到SQL Server之外,您是否将用户添加到要访问的数据库中?这通常是在您创建登录时自动完成的,当您让它访问指定的数据库时,但是可以在事后手动完成。

#3


1  

Try pinging: MEETING-ROOM\SQLSERVERDB

试试震性:会议室\ SQLSERVERDB

And if it gives you a response use the IP Address directly, also ensure that the Server does not have a firewall rule blocking incoming traffic on Port 48006.

如果它给您一个直接使用IP地址的响应,还要确保服务器没有防火墙规则来阻止端口48006上的传入流量。

Also ensure SQL Server is allowing Windows Authentication and SQL Server authentication. This can be done by right clicking on the database in Management Studio and going to properties and Security.

还要确保SQL Server允许Windows身份验证和SQL Server身份验证。这可以通过在Management Studio中右键单击数据库并进入属性和安全性来实现。

#4


0  

i know the question, the problem is not appear on database, is the IIS7.0. there is a service account ,you need change it network in pool. my english not good,if you also can't slove,please send me email:mjjjj2001@163.com

我知道问题是,问题不在数据库中出现,是IIS7.0。有一个服务帐户,您需要更改池中的it网络。我的英语不太好,如果你也看不懂,请发邮件给我:mjjjjj2001@163.com