错误消息:(提供程序:共享内存提供程序,错误:0 - 管道的另一端没有进程。)

发布于 2024-12-15 03:15:41 字数 1557 浏览 4 评论 0 原文

我正在尝试在 Windows Server 2003 上部署我的网站。 我是否遗漏了某些内容,或者以下错误消息有什么问题,我该如何纠正?谢谢,

我收到错误消息:

已成功与服务器建立连接,但在登录过程中发生错误。 (提供程序:共享内存提供程序,错误:0 - 管道的另一端没有进程。) 描述:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其在代码中的来源的更多信息。

异常详细信息:System.Data.SqlClient.SqlException:连接 与服务器建立成功,但随后出现错误 发生在登录过程中。 (提供者:共享内存提供者, 错误:0 - 管道的另一端没有进程。)

来源错误:

执行过程中产生了未处理的异常 当前的网络请求。有关原产地和地点的信息 可以使用下面的异常堆栈跟踪来识别异常。

堆栈跟踪:

[SqlException (0x80131904): 已成功建立连接 与服务器,但在登录过程中发生错误。 (提供程序:共享内存提供程序,错误:0 - 上没有进程 管道的另一端。)]
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection 拥有对象)+1019
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection 拥有连接)+108
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection 外部连接、DbConnectionFactory 连接工厂)+126
System.Data.SqlClient.SqlConnection.Open() +125
NHibernate.Connection.DriverConnectionProvider.GetConnection() +104
NHibernate.Tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.Prepare() +15 NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.GetReservedWords(方言 方言,IConnectionHelper 连接助手)+89
NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.Update(ISessionFactory sessionFactory)+80
NHibernate.Impl.SessionFactoryImpl..ctor(配置cfg,IMapping 映射、Settings 设置、EventListeners 侦听器)+599
NHibernate.Cfg.Configuration.BuildSessionFactory() +104
MyProject.API.Data.SessionManager..cctor() 中 C:\Dev\Code\API\Data\SessionManager.cs:27

I am trying to deploy my website on windows server 2003.
Am i missing something or what is wrong from the following error message, how can I correct it? Thank

I am having the error message:

A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: A connection
was successfully established with the server, but then an error
occurred during the login process. (provider: Shared Memory Provider,
error: 0 - No process is on the other end of the pipe.)

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): A connection was successfully established
with the server, but then an error occurred during the login process.
(provider: Shared Memory Provider, error: 0 - No process is on the
other end of the pipe.)]
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
owningObject) +1019
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
owningConnection) +108
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory) +126
System.Data.SqlClient.SqlConnection.Open() +125
NHibernate.Connection.DriverConnectionProvider.GetConnection() +104
NHibernate.Tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.Prepare()
+15 NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.GetReservedWords(Dialect
dialect, IConnectionHelper connectionHelper) +89
NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.Update(ISessionFactory
sessionFactory) +80
NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IMapping
mapping, Settings settings, EventListeners listeners) +599
NHibernate.Cfg.Configuration.BuildSessionFactory() +104
MyProject.API.Data.SessionManager..cctor() in
C:\Dev\Code\API\Data\SessionManager.cs:27

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(29

断念 2024-12-22 03:15:42

“真正的”错误位于 SQL 错误日志中:

C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\log\ERRORLOG

路径取决于您的 SQL Server 版本

The "real" error was in the SQL error log:

C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\log\ERRORLOG

Path will depend on your version of SQL Server

往日 2024-12-22 03:15:42

将其添加到我的连接字符串对我有用:

Trusted_Connection=true

Adding this to my connection string worked for me:

Trusted_Connection=true
青丝拂面 2024-12-22 03:15:42

您应该将服务器身份验证模式启用为混合模式,如下所示:
在 SQL Studio 中,选择 YourServer ->属性->安全->选择SqlServer和Window身份验证模式。

You should enable the Server authentication mode to mixed mode as following:
In SQL Studio, select YourServer -> Property -> Security -> Select SqlServer and Window Authentication mode.

謌踐踏愛綪 2024-12-22 03:15:42

使用 Windows 凭据转到 SQL Server - >登录->选择登录->在属性->检查登录是否启用/禁用。
如果禁用,请将其启用,此解决方案对我有用。

Goto to SQL server using windows Credentials - > Logins - > Select the Login - > in the Properties -> Check if the Log in is enabled/disabled.
If Disabled, make it enable, this solution worked for me.

神回复 2024-12-22 03:15:42

在 C# 和 SQL SERVER 中,我们可以通过将 Integrated Security = true 添加到连接字符串来修复错误。

请找到完整的连接字符串:

constr = @"Data Source=<Data-Source-Server-Name>;Initial Catalog=<DB-Name>;Integrated Security=true";

In C# and SQL SERVER, we can fix the error by adding Integrated Security = true to the connection string.

Please find the full connection string:

constr = @"Data Source=<Data-Source-Server-Name>;Initial Catalog=<DB-Name>;Integrated Security=true";
策马西风 2024-12-22 03:15:42

我遇到了同样的错误,通过确保 SQL Server 启用了 SQL 身份验证模式来修复它。

请参阅下面的图片。

  1. 要启用,请转到服务器属性。
    输入图片此处描述

  2. 单击“安全”选项卡,选择 SQL 服务器和窗口服务器身份验证模式,然后按“确定”

在此处输入图像描述

  1. 您需要重新启动服务器才能反映更改,现在应该没问题了。

输入图片此处描述

I had the same error, Fixed it by ensuring that SQL server had SQL authentication mode enabled.

see images below.

  1. To enable, go to server properties.
    enter image description here

  2. Click on the Security tab and select the SQL server and window server auth mode and press ok

enter image description here

  1. You will need to restart the server for the changes to reflect, should be fine now.

enter image description here

风柔一江水 2024-12-22 03:15:42

我今天收到这个错误。就我而言,查看 SQL 服务器上的 ERRORLOG 文件会出现以下错误:

用户“”登录失败。原因:无法打开
登录属性中指定的数据库“”。

这是因为我前几天删除了该用户的“默认数据库”。将默认数据库设置为我的新数据库解决了问题。

希望这对其他人有帮助。

I was getting this error today. In my case, looking at the ERRORLOG file on the SQL server gave me this error:

Login failed for user ''. Reason: Failed to open the
database '' specified in the login properties.

This was because I had deleted the "Default database" of this user a few days ago. Setting the default database to my new database fixed the problem.

Hope this helps someone else.

沧笙踏歌 2024-12-22 03:15:42

通过查看“C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Log\ERRORLOG”中的SQL SERVER日志文件,它说
“用户‘XXXXX’登录失败。原因:尝试使用 SQL 身份验证登录失败。服务器配置为仅 Windows 身份验证。[CLIENT: ]”

修复方法是打开“Microsoft SQL Server Management Studio”->“Windows 身份验证”。右键单击SQL Server,然后选择“属性”->安全->将身份验证更改为混合模式。 ->重新启动 SQL 服务器。

By looking into SQL SERVER log file in "C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Log\ERRORLOG", it says
"Login failed for user 'XXXXX'. Reason: An attempt to login using SQL authentication failed. Server is configured for Windows authentication only. [CLIENT: ]"

The fixing method is to open "Microsoft SQL Server Management Studio" -> Right click the SQL server and then select "Properties" -> Security -> Change the authentication to mixed mode. -> Restart SQL server.

紫瑟鸿黎 2024-12-22 03:15:42

我忘记添加“密码=xxx;”在我的例子中的连接字符串中。

I forgot to add the "Password=xxx;" in the connection string in my case.

大姐,你呐 2024-12-22 03:15:42

所有良好且有效的调查过程,尤其是获取更多信息的日志。

对于那些遇到此问题的人来说,这可能是一个简单的陷阱,当您创建数据库用户时,您可能已强制执行密码策略并让用户在首次登录时更改密码(即将密码字段周围的复选框保留为其默认值) 。

在 SQL Management Studio 中很容易完成,当然可能会立即导致身份验证问题,除非您查看日志,否则这些问题会被掩盖。

All good and valid courses of investigation especially the logs for more info.

For those hitting this it might be a simple gotcha where when you have created the DB User you may have enforced a password policy and left the user to change the password on first login (i.e. left the checkboxes around the password field at their default values).

Very easily done in SQL Management Studio and can of course cause authentication issues off the bat that are masked unless you look into the logs.

少女的英雄梦 2024-12-22 03:15:42

就我而言,这是连接字符串中数据库名称的拼写错误。

In my case it was a spelling mistake in the database name in connection string.

笑咖 2024-12-22 03:15:42

就我而言,我的磁盘已满 99%,在我释放了 80% 的磁盘空间后它就可以工作了。

In my case My disk was full 99%, It worked after I freed up to 80% of the disk.

Hello爱情风 2024-12-22 03:15:42

安装 MSSQL 服务器时启用混合身份验证模式。还提供 sa 用户的密码。

Enable Mixed authentication mode while installing MSSQL server. Also provide password for sa user.

策马西风 2024-12-22 03:15:42

您好,只需按照下面所附的屏幕截图启用服务器身份验证。

在此处输入图像描述

Hi Just enable both for server authentication as per screen shot attached below.

enter image description here

诠释孤独 2024-12-22 03:15:42

检查您使用 SQL Management Studio 登录的服务器名称是否与您的连接字符串匹配。

我今天收到这个错误。
原来我没有意识到安装了 SQL Server 的机器上运行着多个服务器。事实上,我已将数据库放在与我认为使用的服务器完全不同的服务器中。 (所以我的连接字符串指向没有数据库的服务器)

因此,当.net尝试访问数据库时,它找不到任何东西,并且只给出了有关管道的误导性错误消息。

我在 SQL Management Studio 中打开了正确的服务器,添加了我的数据库,然后一切正常。
(如果下拉列表中没有正确的服务器,请尝试浏览查找。)

显示与正确服务器名称匹配的连接字符串的图像

Check that the server name you're logging into with SQL Management Studio matches your connection string.

I was getting this error today.
It turned out that I hadn't realised the machine with SQL Server installed had multiples servers running. I had in fact put my database in a totally different server to the one I thought I was using. (So my connection string was pointing to a server with no database)

Hence, When .net tried to access the database it couldn't find anything and gave only a misleading error message about pipes.

I opened the correct server in SQL Management Studio, added my database to and then all worked fine.
(If the correct server isn't available in the dropdown, try browsing for it.)

Image showing the connection string matching the correct server name

迷离° 2024-12-22 03:15:42

这是旧的,但我在连接对话框中遇到问题,它仍然默认为我已删除的数据库。通过运行这些命令,提示中的默认数据库没有改变。
我在现在找不到的地方读到,如果您打开“连接到服务器”对话框,然后选择“选项”并通过键入默认数据库((从下拉列表中选择)数据库将保留输入的新值。这对我来说听起来像是一个缺陷,但如果有人想知道这一点,这应该可以解决这个问题,至少在 SQL Server 2012 上

This is old but I had the problem in the connect dialog that it was still defaulting to a database I had removed. And by running those commands the default database in the prompt wasn't changing.
I read somewhere I can't find now, that if you open the "Connect to Server" dialog and then select "Options" and select "Connection Properties" tab by typing the default database (no by selecting from the drop down) the database will then stay on that new value entered. This sounds like a flaw to me but in case someone was wondering about that, that should fix the issue, at least on SQL Server 2012

束缚m 2024-12-22 03:15:42

我知道我可能是唯一一个会以这种方式遇到此问题的人。但是如果你删除了C:/{user}/目录下的mdf文件,你也会得到这个错误。恢复它,你就是金色的

I know i am probably the only one that will have this problem in this way. but if you deleted the mdf files in the C:/{user}/ directory, you will get this error too. restore it and you are golden

家住魔仙堡 2024-12-22 03:15:42

我在一个代码优先的应用程序中遇到了这个问题,该应用程序期望数据库在那里:

确保数据库已创建/连接字符串中的名称正确。

I ran across this in a code-first application which expected the database to be there:

Make sure the database is created / the name in the connection string is correct.

扛刀软妹 2024-12-22 03:15:42

我也有同样的问题。我尝试了本页中所有建议的答案,但没有成功!最后,我尝试了以下步骤,它对我有用:

在 SQL Server Management Studio 对象资源管理器中,右键单击服务器,然后单击“属性”。

  1. 在“安全”页面上的“服务器身份验证”下,选择新的
    服务器验证模式,然后单击“确定”。
  2. 在“SQL Server Management Studio”对话框中,单击“确定”
    确认重新启动 SQL Server 的要求。
  3. 在对象资源管理器中,右键单击您的服务器,然后单击“重新启动”。
    如果 SQL Server 代理正在运行,则还必须重新启动它。

然后在包管理器控制台中尝试以下操作:

Scaffold-DbContext "Server=YourServer;Database=YourDB;Persist Security Info=False;User=YourUserName; Password=YourPassword; MultipleActiveResultSets=False;Encrypt=False; TrustServerCertificate=False; Connection Timeout=30;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -Context DatabaseContext -f

I had the same problem. I tried all the suggested answers in this page but to no avail! Finally, I tried the steps below and it worked for me:

In SQL Server Management Studio Object Explorer, right-click the server, and then click Properties.

  1. On the Security page, under Server authentication, select the new
    server authentication mode, and then click OK.
  2. In the SQL Server Management Studio dialog box, click OK to
    acknowledge the requirement to restart SQL Server.
  3. In Object Explorer, right-click your server, and then click Restart.
    If SQL Server Agent is running, it must also be restarted.

Then try this in your Package Manager Console:

Scaffold-DbContext "Server=YourServer;Database=YourDB;Persist Security Info=False;User=YourUserName; Password=YourPassword; MultipleActiveResultSets=False;Encrypt=False; TrustServerCertificate=False; Connection Timeout=30;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -Context DatabaseContext -f
酷炫老祖宗 2024-12-22 03:15:42

就我而言,我的情况有点不同。

1.我的错误:我漏掉了一个“;”在字符串连接中。我知道这是一个新手错误,但我对 C# 和 SQL Server 很陌生。我也有这么一天:)

private string connectionString = "Data Source=localhost;Initial Catalog=FundamentalsCSharp" 
       + "User=sa;Password=123456";

2.我的解决方案:放一个“;”在短语“FundamentalsCSharp”之后它丢失了,但它起作用了。

private string connectionString = "Data Source=localhost;Initial Catalog=FundamentalsCSharp;" 
       + "User=sa;Password=123456";

3.注意:将“FundamentalsCSharp”更改为您拥有的初始目录。

我希望这对某人有用。谢谢!

In my case, my situation was a little different.

1. My Mistake: I was missing a ";" in stringConnection. I know this is a newbie bug, but I am new to C # and SQL Server. I have one day :)

private string connectionString = "Data Source=localhost;Initial Catalog=FundamentalsCSharp" 
       + "User=sa;Password=123456";

2. My Solution: Put a ";" it was missing after the phrase "FundamentalsCSharp" and it worked.

private string connectionString = "Data Source=localhost;Initial Catalog=FundamentalsCSharp;" 
       + "User=sa;Password=123456";

3. Note: Change "FundamentalsCSharp" for your owned Initial Catalog.

I hope this can be of use to someone. Thanks!

や莫失莫忘 2024-12-22 03:15:42

就我而言,我的项目是 Asp.net Core 3.1 ,这是我的连接字符串

"ConnectionString": "Data Source=.; Initial Catalog=WebDB; user Id=sa; Password=123"

和 sql server webdb 中的数据库名称(sql server 中的小写)。
经过多次更改连接字符串中的数据库名称 webdb 并且工作正常。

In my case, my project is Asp.net Core 3.1 and this is my connection string

"ConnectionString": "Data Source=.; Initial Catalog=WebDB; user Id=sa; Password=123"

And database name in sql server webdb (lower case in sql server).
After many time change database name webdb in connecion string and worked fine.

裂开嘴轻声笑有多痛 2024-12-22 03:15:42

对于那些首先执行实体框架代码的人,还要检查以确保您已完成迁移。
查找根本原因的最佳位置是 sql server 错误日志

For those doing entityframework code first, also check to enture you have done your migrations.
The best place to look for the root cause is the sql server error log

┈┾☆殇 2024-12-22 03:15:42

就我而言,问题是我的 SQL SERVER 密码已过期

In my case,the issue was that my SQL SERVER password had expired

残疾 2024-12-22 03:15:42

这可能是由于“ConnectionStrings”:{}在.net core应用程序中多次使用,这就是我的情况的问题,我有多个json文件,一个是appsettings.json,另一个是serilogconfiguration.json,但正如提到的“ConnectionStrings”也在 appsettings.json 中进行了配置,并且与 serilogconfiguration.json 相同,可能在某个地方发生冲突。所以我必须从 appsettings.json 中删除它并且它起作用了

this could be due to "ConnectionStrings": {} used multiple times at .net core application, that was the issue in my case i had multiple json file one was appsettings.json and another one was serilogconfiguration.json but as mentioned "ConnectionStrings" was configured at appsettings.json as well and same with serilogconfiguration.json might be somewhere it was conflicting. so i had to remove it from appsettings.json and it worked

白首有我共你 2024-12-22 03:15:41

通常,要解决此问题,请转到 SQL Server 配置管理器 (SSCM) 并:

  1. 确保启用共享内存协议
  2. 确保启用命名管道协议
  3. 确保启用 TCP/IP,并且在设置中位于命名管道之前

也许可以帮助: 无法打开与 SQL Server 的连接

注意:如果这是 SQL Server 的新实例,请确保SQL Server和窗户启用身份验证

  1. 在 SSMS 中右键单击服务器并拉出服务器属性
  2. 转到安全性-->选择“SQL Server 和 Windows 身份验证模式”
  3. 重新启动服务器并使用凭据登录

Typically, to troubleshoot this, you go to SQL Server Configuration Manager (SSCM) and:

  1. ensure Shared Memory protocol is enabled
  2. ensure Named Pipes protocol is enabled
  3. ensure TCP/IP is enabled, and is ahead of the Named Pipes in the settings

Maybe it can help: Could not open a connection to SQL Server

Note : If this is a new instance of SQL Server be sure SQL Server and Windows Authentication is enabled

  1. Right Click the Server in SSMS and pull up server properties
  2. Go to Security--> Select 'SQL Server and Windows Authentication Mode'
  3. Restart the Server and Login with the credentials
铜锣湾横着走 2024-12-22 03:15:41

检查您的连接字符串是否添加了 "Trusted_Connection=true"

Check if your connection string has "Trusted_Connection=true" added.

梦初启 2024-12-22 03:15:41

我收到了同样的错误消息,结果发现这是因为我没有启用混合模式身份验证。我只使用 Windows Auth。这在 vSphere 的默认 MSSQL 部署中很常见,并且在升级到 vSphere 5.1 时成为一个问题。

要更改为混合模式身份验证,您可以按照 http://support.webecs.com/kb/a374/how-do-i-configure-sql-server-express-to-enable-mixed-mode-authentication.aspx

I had this same error message, turns out it was because I didn't have mixed mode auth enabled. I was on Windows Auth only. This is common in default MSSQL deployments for vSphere, and becomes an issue when upgrading to vSphere 5.1.

To change to mixed mode auth you can follow the instructions at http://support.webecs.com/kb/a374/how-do-i-configure-sql-server-express-to-enable-mixed-mode-authentication.aspx.

萌能量女王 2024-12-22 03:15:41

我在 SQL Server Management Studio 中遇到了同样的错误。

我发现要查看更具体的错误,请查看 SQL Server 创建的日志文件。当我打开日志文件时,我发现这个错误

无法连接,因为最大用户连接数已达到“2”个
已经达到了。系统管理员可以使用
sp_configure 增加最大值。连接已
已关闭

了相当多的时间来解决这个问题。最后运行以下代码解决了我的问题。

sp_configure 'show advanced options', 1;
go

reconfigure
go

sp_configure 'user connections', 0
go

reconfigure
go

更多关于此处此处

编辑

要查看日志在 Windows 启动按钮上搜索“日志”,然后单击“查看事件日志”。从那里转到“Windows 日志”下的应用程序。您还可以选择“系统”日志来查看系统错误。您可以通过单击右侧的“过滤当前日志”,然后选择“错误复选框”来对当前日志进行过滤。

I had the same error by in SQL Server Management Studio.

I found that to look at the more specific error, look at the log file created by the SQL Server. When I opened the log file, I found this error

Could not connect because the maximum number of ’2′ user connections
has already been reached. The system administrator can use
sp_configure to increase the maximum value. The connection has been
closed

I spend quite some time figuring this out. Finally running the following code fixed my problem.

sp_configure 'show advanced options', 1;
go

reconfigure
go

sp_configure 'user connections', 0
go

reconfigure
go

More on here and here

Edit

To view logs search for "logs" on windows startup button, click "view events logs". From there go to Applications under "Windows Logs". You can also choose "System" logs to see system wise errors. You can use filter on current logs by clicking "Filter Current Logs" on right side and then select "Error checkbox".

软糯酥胸 2024-12-22 03:15:41

只是另一种可能性。我必须重新启动 sql server 服务才能解决这个问题。

Just another possibility. I had to restart the sql server service to fix this issue for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文