Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A connection was successfully established with the server, but then an error occurred during the pre-login handshake in SQL Server 2012

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

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)

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

  • 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);
  • I CAN connect to SQL Server using UDL;
  • I tried to re-install SQL Server with all related components;
  • Tried to uninstall .NET 4.5;
  • In SQL Management Studio, in connection properties, Encrypt Connection is unchecked.

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

like image 457
user2816785 Avatar asked Sep 03 '25 13:09

user2816785


2 Answers

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.

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

Expand the SQL Network Configuration and click on the PROTOCOLS node

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

Select the IP ADDRESS tab

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

like image 152
jignesh Avatar answered Sep 05 '25 12:09

jignesh


I got this error connecting to localhost with the newest version of Microsoft.Data.SqlClient.

Turns out that Microsoft really wants you to encrypt your database, for security.

This can be fixed client side by changing the connection string, by adding an Encrypt=False parameter, eg:

SERVER=.\SQLEXPRESS;DATABASE=MyDatabase;Integrated Security=True;Encrypt=False;

See Rick strah's blog post on the subject

like image 41
Loris Avatar answered Sep 05 '25 12:09

Loris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!