已成功与服务器建立连接,但在SQL Server 2012中的登录前握手期间发生了错误

时间:2022-01-01 01:55:02

Today I could not log into my local SQL Server 2012 instance with the following error message

今天我无法使用以下错误消息登录到我的本地SQL Server 2012实例

A connection was successfully established with the server, but then an error occurred during the pre-login handshake.

已成功与服务器建立连接,但在登录前握手期间发生错误。

provider: SSL Provider, error: 0 - An internal error occurred. (Microsoft SQL Server, Error: -2146893792)

provider:SSL Provider,错误:0 - 发生内部错误。 (Microsoft SQL Server,错误:-2146893792)

I found many similar questions here and on the forums, but nothing helped. Please notice that in my case it just says

我在这里和论坛上发现了许多类似的问题,但没有任何帮助。请注意,就我而言,它只是说

0 - An internal error occurred

0 - 发生内部错误

  • There are no errors in Event Viewer;
  • 事件查看器中没有错误;
  • I don't use Encrypted Connections;
  • 我不使用加密连接;
  • In SQL Server Configuration Manager, Force Protocol Entryption is set to False, Trust Server Certificate is set to Yes (Originally it was No, but in both cases it didn't work);
  • 在SQL Server配置管理器中,强制协议入口设置为False,信任服务器证书设置为是(原来它是否,但在两种情况下它都不起作用);
  • I CAN connect to SQL Server using UDL;
  • 我可以使用UDL连接到SQL Server;
  • I tried to re-install SQL Server with all related components;
  • 我尝试使用所有相关组件重新安装SQL Server;
  • Tried to uninstall .NET 4.5;
  • 试图卸载.NET 4.5;
  • In SQL Management Studio, in connection properties, Encrypt Connection is unchecked.
  • 在SQL Management Studio中,在连接属性中,取消选中“加密连接”。

It worked fine yesterday, I have not installed any software since then.

它昨天工作正常,从那以后我没有安装任何软件。

3 个解决方案

#1


3  

check that TCP/IP protocol is not enabled for clients. Without TCP/IP protocol you can not access the sql server from other clients. Following is the method to enable the protocol.

检查是否未为客户端启用TCP / IP协议。如果没有TCP / IP协议,则无法从其他客户端访问sql server。以下是启用协议的方法。

Go to the: Start-->Programs-->SQL Server--> Configuration Tools-->SQL Configuration Manager.

转到:开始 - >程序 - > SQL Server - >配置工具 - > SQL配置管理器。

Expand the SQL Network Configuration and click on the PROTOCOLS node

展开SQL网络配置,然后单击PROTOCOLS节点

Right click on TCP/IP and open up the PROPERTIES panel

右键单击TCP / IP并打开“属性”面板

Select the IP ADDRESS tab

选择IP ADDRESS选项卡

http://sqlanddotnetdevelopment.blogspot.in/2013/07/a-connection-was-successfully.html

http://sqlanddotnetdevelopment.blogspot.in/2013/07/a-connection-was-successfully.html

#2


0  

In our case same error occurred due to spn not set.Try checking if spn is set. As others suggested in comments you can see ring buffer entries which holds more info .if you are able to repro more often try running netmon or wireshark in parallel

在我们的例子中,由于spn未设置而发生同样的错误。请检查是否设置了spn。正如其他人在评论中建议的那样,您可以看到包含更多信息的环形缓冲区条目。如果您能够更频繁地重新尝试,请尝试并行运行netmon或wireshark

#3


0  

In our case it was the problem with the SSL/TLS. We just disabled tls 1.0 to make sure we were compliant with PCI DSS but it stopped SQL Server. Then we had to install one update from Microsoft and then did the disable thing using IISCrypto instead of using the registry. Here's the steps we followed: https://www.itechtics.com/connection-successfully-established-error-occured-pre-login-handshake/

在我们的例子中,这是SSL / TLS的问题。我们刚刚禁用了tls 1.0以确保我们符合PCI DSS但它停止了SQL Server。然后我们必须从Microsoft安装一个更新,然后使用IISCrypto而不是使用注册表来执行禁用。以下是我们遵循的步骤:https://www.itechtics.com/connection-successfully-established-error-occured-pre-login-handshake/

#1


3  

check that TCP/IP protocol is not enabled for clients. Without TCP/IP protocol you can not access the sql server from other clients. Following is the method to enable the protocol.

检查是否未为客户端启用TCP / IP协议。如果没有TCP / IP协议,则无法从其他客户端访问sql server。以下是启用协议的方法。

Go to the: Start-->Programs-->SQL Server--> Configuration Tools-->SQL Configuration Manager.

转到:开始 - >程序 - > SQL Server - >配置工具 - > SQL配置管理器。

Expand the SQL Network Configuration and click on the PROTOCOLS node

展开SQL网络配置,然后单击PROTOCOLS节点

Right click on TCP/IP and open up the PROPERTIES panel

右键单击TCP / IP并打开“属性”面板

Select the IP ADDRESS tab

选择IP ADDRESS选项卡

http://sqlanddotnetdevelopment.blogspot.in/2013/07/a-connection-was-successfully.html

http://sqlanddotnetdevelopment.blogspot.in/2013/07/a-connection-was-successfully.html

#2


0  

In our case same error occurred due to spn not set.Try checking if spn is set. As others suggested in comments you can see ring buffer entries which holds more info .if you are able to repro more often try running netmon or wireshark in parallel

在我们的例子中,由于spn未设置而发生同样的错误。请检查是否设置了spn。正如其他人在评论中建议的那样,您可以看到包含更多信息的环形缓冲区条目。如果您能够更频繁地重新尝试,请尝试并行运行netmon或wireshark

#3


0  

In our case it was the problem with the SSL/TLS. We just disabled tls 1.0 to make sure we were compliant with PCI DSS but it stopped SQL Server. Then we had to install one update from Microsoft and then did the disable thing using IISCrypto instead of using the registry. Here's the steps we followed: https://www.itechtics.com/connection-successfully-established-error-occured-pre-login-handshake/

在我们的例子中,这是SSL / TLS的问题。我们刚刚禁用了tls 1.0以确保我们符合PCI DSS但它停止了SQL Server。然后我们必须从Microsoft安装一个更新,然后使用IISCrypto而不是使用注册表来执行禁用。以下是我们遵循的步骤:https://www.itechtics.com/connection-successfully-established-error-occured-pre-login-handshake/