我正在尝试在 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
发布评论
评论(29)
“真正的”错误位于 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
将其添加到我的连接字符串对我有用:
Adding this to my connection string worked for me:
您应该将服务器身份验证模式启用为混合模式,如下所示:
在 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.
使用 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.
在 C# 和 SQL SERVER 中,我们可以通过将
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:
我遇到了同样的错误,通过确保 SQL Server 启用了 SQL 身份验证模式来修复它。
请参阅下面的图片。
要启用,请转到服务器属性。
单击“安全”选项卡,选择 SQL 服务器和窗口服务器身份验证模式,然后按“确定”
I had the same error, Fixed it by ensuring that SQL server had SQL authentication mode enabled.
see images below.
To enable, go to server properties.
Click on the Security tab and select the SQL server and window server auth mode and press ok
我今天收到这个错误。就我而言,查看 SQL 服务器上的 ERRORLOG 文件会出现以下错误:
这是因为我前几天删除了该用户的“默认数据库”。将默认数据库设置为我的新数据库解决了问题。
希望这对其他人有帮助。
I was getting this error today. In my case, looking at the ERRORLOG file on the SQL server gave me this error:
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.
通过查看“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.
我忘记添加“密码=xxx;”在我的例子中的连接字符串中。
I forgot to add the "Password=xxx;" in the connection string in my case.
所有良好且有效的调查过程,尤其是获取更多信息的日志。
对于那些遇到此问题的人来说,这可能是一个简单的陷阱,当您创建数据库用户时,您可能已强制执行密码策略并让用户在首次登录时更改密码(即将密码字段周围的复选框保留为其默认值) 。
在 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.
就我而言,这是连接字符串中数据库名称的拼写错误。
In my case it was a spelling mistake in the database name in connection string.
就我而言,我的磁盘已满 99%,在我释放了 80% 的磁盘空间后它就可以工作了。
In my case My disk was full 99%, It worked after I freed up to 80% of the disk.
安装 MSSQL 服务器时启用混合身份验证模式。还提供 sa 用户的密码。
Enable Mixed authentication mode while installing MSSQL server. Also provide password for sa user.
您好,只需按照下面所附的屏幕截图启用服务器身份验证。
Hi Just enable both for server authentication as per screen shot attached below.
检查您使用 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.)
这是旧的,但我在连接对话框中遇到问题,它仍然默认为我已删除的数据库。通过运行这些命令,提示中的默认数据库没有改变。
我在现在找不到的地方读到,如果您打开“连接到服务器”对话框,然后选择“选项”并通过键入默认数据库(否(从下拉列表中选择)数据库将保留输入的新值。这对我来说听起来像是一个缺陷,但如果有人想知道这一点,这应该可以解决这个问题,至少在 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
我知道我可能是唯一一个会以这种方式遇到此问题的人。但是如果你删除了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
我在一个代码优先的应用程序中遇到了这个问题,该应用程序期望数据库在那里:
确保数据库已创建/连接字符串中的名称正确。
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.
我也有同样的问题。我尝试了本页中所有建议的答案,但没有成功!最后,我尝试了以下步骤,它对我有用:
在 SQL Server Management Studio 对象资源管理器中,右键单击服务器,然后单击“属性”。
服务器验证模式,然后单击“确定”。
确认重新启动 SQL Server 的要求。
如果 SQL Server 代理正在运行,则还必须重新启动它。
然后在包管理器控制台中尝试以下操作:
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.
server authentication mode, and then click OK.
acknowledge the requirement to restart SQL Server.
If SQL Server Agent is running, it must also be restarted.
Then try this in your Package Manager Console:
就我而言,我的情况有点不同。
1.我的错误:我漏掉了一个“;”在字符串连接中。我知道这是一个新手错误,但我对 C# 和 SQL Server 很陌生。我也有这么一天:)
2.我的解决方案:放一个“;”在短语“FundamentalsCSharp”之后它丢失了,但它起作用了。
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 :)
2. My Solution: Put a ";" it was missing after the phrase "FundamentalsCSharp" and it worked.
3. Note: Change "FundamentalsCSharp" for your owned Initial Catalog.
I hope this can be of use to someone. Thanks!
就我而言,我的项目是
Asp.net Core 3.1
,这是我的连接字符串和 sql server
webdb
中的数据库名称(sql server 中的小写)。经过多次更改连接字符串中的数据库名称
webdb
并且工作正常。In my case, my project is
Asp.net Core 3.1
and this is my connection stringAnd database name in sql server
webdb
(lower case in sql server).After many time change database name
webdb
in connecion string and worked fine.对于那些首先执行实体框架代码的人,还要检查以确保您已完成迁移。
查找根本原因的最佳位置是 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
就我而言,问题是我的 SQL SERVER 密码已过期
In my case,the issue was that my SQL SERVER password had expired
这可能是由于“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
通常,要解决此问题,请转到 SQL Server 配置管理器 (SSCM) 并:
也许可以帮助: 无法打开与 SQL Server 的连接
注意:如果这是 SQL Server 的新实例,请确保SQL Server和窗户启用身份验证
Typically, to troubleshoot this, you go to SQL Server Configuration Manager (SSCM) and:
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
检查您的连接字符串是否添加了
"Trusted_Connection=true"
。Check if your connection string has
"Trusted_Connection=true"
added.我收到了同样的错误消息,结果发现这是因为我没有启用混合模式身份验证。我只使用 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.
我在 SQL Server Management Studio 中遇到了同样的错误。
我发现要查看更具体的错误,请查看 SQL Server 创建的日志文件。当我打开日志文件时,我发现这个错误
了相当多的时间来解决这个问题。最后运行以下代码解决了我的问题。
更多关于此处和此处
编辑
要查看日志在 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
I spend quite some time figuring this out. Finally running the following code fixed my problem.
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".
只是另一种可能性。我必须重新启动 sql server 服务才能解决这个问题。
Just another possibility. I had to restart the sql server service to fix this issue for me.