Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

Weird connection Problem

Nitroxid's profile image Nitroxid posted 3 months ago in Creating a connection Permalink

Hi,

I have a weird problem when trying to connect to a new MySQL Server (8.0.28 on Ubuntu 20.04). I'm using HeidiSQL 11.3.0.6295 via Wine on Ubuntu 20.04 and trying to connect via a SSH Tunnel.

The tunnel seems to be working, but I can't get a connection to MySQL. The error messages vary depending on the library used:

libmariadb.dll: Unknown MySQL error libmysql-6.1.dll: SSL connection error: unknown error number libmysql.dll: Access denied for user (the credentials are working fine with "mysql -p -u")

But now comes the weird part. I noticed I sometimes can connect to the server, when I'm also logged in as root via a seperate SSH connection. I'm not using root in HeidiSQL btw. Might also be a coincidence, as I'm currently not able to reproduce it.

I also am running a local server with the same config and have no issues connecting to that.

Any suggestions?

ansgar's profile image ansgar posted 3 months ago Permalink

Did you activate SSL for that connection in HeidiSQL?

You could

  • install the latest nightly installer from Feb 13
  • then update to the latest nightly build, through Help > Check for updates

Recent modifications made some SSL fixes.

Nitroxid's profile image Nitroxid posted 3 months ago Permalink

First, thank you for the reply and the great work you're doing.

SSL is not enabled for the connection (The checkbox in the SSL-Tab is not checked).

I tried downloading the installer, but I was told the Windows version is not supported. Then I downloaded Revision 11.3.0.6415 and tried it directly, but the problem still persists.

Lastly I had a suspicion Wine might be the problem, as I had wine 5.0 installed via the Ubuntu repos. So I updated Wine to the newest stable (7.0). But that didn't help as well, neither with my initial problem, nor with the version error in the nightly installer.

The only difference is that, using libmariadb.dll, the error now just seems to be an empty string. With the other libraries the message stayed the same.

I can make changes to the config of the MySQL-Server as well, if you think there is something that might help. So only thing I have to use is the SSL-Tunnel, as the Hoster is blocking Port 3306.

I've attached a log from the nightly build, just in case it might helpful.

1 attachment(s):
Nitroxid's profile image Nitroxid posted 3 months ago Permalink

Ok, it most definitely is a problem with Wine.

I just exported the setting from my Ubuntu machine to my notebook, which is running Win 10, and the connection worked first time.

ansgar's profile image ansgar posted 3 months ago Permalink

Is the HeidiSQL version the same on the Win10 box?

If you still want to try on Wine/Ubuntu you should update some files by hand (as the installer does not work as you said):

Be sure to remove the "64" prefixes from the downloads.

Nitroxid's profile image Nitroxid posted 3 months ago Permalink

Updating libmariadb.dll did the trick. Thank you very much!

shyam's profile image shyam posted 3 months ago Permalink

We've recently migrated our SQL server from Server/SQL Server 2K8R2 to SQL Server 2017/Server 2019. We have quite a few .NET webapps and applications that are intermittently unable to connect, with the following error being logged:

System.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - An existing connection was forcibly closed by the remote host.) ---> System.ComponentModel.Win32Exception (0x80004005): An existing connection was forcibly closed by the remote host

These webapps/applications are ran from a 2K8R2 server. The errors never occur on the same apps, and subsequent connections are successful. We don't force and encryption on the SQL server, and our application connection streams do not specify encryption. The SQL server does not log any unsuccessful login attempts, nor does the OS security logs. As the error is coming from the SSL provider, I've made sure SCHANNEL protocols and ciphers align, as well as enabled both SCHANNEL errors and warnings. Nothing is logged when this happens. The last thing I've done is add a certificate to the SQL server. As of yet I haven't seen any further errors, but since it happens so intermittently, I'm not willing to say this fixed the issue. Even if it did, why would the connection be attempting to use TLS? Has anyone experienced of or heard of a similar issue? Appreciate any thoughts.

Update: Unfortunately adding the certificate, while now encrypted traffic works, did not fix the issue.

Please login to leave a reply, or register at first.




Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.