SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[11.5.362 Pro] - Unable to connect to MariaDB using ADO

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[11.5.362 Pro] - Unable to connect to MariaDB using ADO
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 2100

Post [11.5.362 Pro] - Unable to connect to MariaDB using ADO Reply with quote
I've run into a very strange issue connecting to MariaDB instances. It manifested yesterday when all my connections that worked the day before suddenly stopped connecting properly and threw an error message instead:



The sqlassist.log does not contain anything besides the text already displayed by the error dialog:
Quote:

2021. 07. 21. 10:25:22 SqlEditor.exe Error: Connection failed.
Can't find "MySql.Data.MySqlClient" class.
Try to connect the parent IDE first.


The data provider is set to MySql.Data.MySqlClient (.Net 4). If I set it to MySql.Data.MySqlClient, I get a different kind of error message:



But I've never used that one (I recall it never worked for me), I always used MySql.Data.MySqlClient (.Net 4)

So far I've restarted SA/SE, rebooted my machine, and downgraded the MySQL Connector Net from 8.0.26 to 8.0.20 (one of my colleagues uses that one, and she is able to connect to the servers). None of those helped. The other two connection types (ODBC and MariaDB Native) work, but as we know, they don't work particularly well. I need ADO.

Any hints on the possible cause of the issue and how to fix it?
Wed Jul 21, 2021 4:19 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7833

Post Reply with quote
I guess something has changed on your system that impacted dependencies of MySql.Data.MySqlClient (.Net 4). I've also experienced this myself. Most ADO.NET drivers are architecture agnostic, Using them with 32-bit or 64-bit applications usually makes no differences, .NET takes care of the architecture. No so with MySQL ADO driver. If 32-bit libraries or dependencies get in the way of 64-bit version of SASE, the same kind of message pops up on the screen. Restarting SASE usually resolves it.
Wed Jul 21, 2021 12:37 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2100

Post Reply with quote
Okay, this is madness. I have tried everything I could imagine. I cycled the connection types, ODBC and Native were always working, ADO never did. Both SA, SE have been restarted several times. I've even rebooted several times. Nothing helped. I gave up after 3 hours of unsuccessful tinkering. So to not to waste more time at the office. I started using ODBC. As usual, at the end of the day, I put the machine into sleep mode and came home. Now I woke it from its slumber, connected it to VPN, and then connected to one of the servers. I accidentally used one of the connections that were still set to ADO and it worked. Nothing was restarted or rebooted after the last unsuccessful attempt.

I hate these self-repairing errors. They tend to self-break again, sooner or later (usually sooner).
Wed Jul 21, 2021 1:01 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7833

Post Reply with quote
My wild guess, when you vpn, you may have some network shares accessible/not accessible which are referenced in the search %PATH% and changes which libraries get found and loaded. Similarly if you remote to your destktop, your local drives get shared too via RDP.
Wed Jul 21, 2021 3:45 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2100

Post Reply with quote
Highly unlikely (though I cannot rule it out completely). Besides, this Monday, when it was still working, it involved no VPN, as I was at the office.
Wed Jul 21, 2021 5:13 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7833

Post Reply with quote
There is one other possibility. If you restore tabs on startup they use remembered connections. If one of them saved wrong settings like mismatching architecture or file path, and is getting restored first, it may impact other restored documents and new tabs if the same type of driver is selected in all of them.
Wed Jul 21, 2021 8:21 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2100

Post Reply with quote
That would explain why restored tabs or reopened files (that also seem to remember their connection) would not connect. But I created new connections and then started SE plain empty (with nothing restored), just to test what happens and even those weren't working, not even the ones that tried to connect to servers I've never connected to. I guess SA/SE mindlessly displays whatever error message is passed by the connection (or in this case, when trying to build a connection). Am I right?
Thu Jul 22, 2021 7:04 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7833

Post Reply with quote
The part of the message following "Connection failed." is actually a pass through error that bubbles up from the downstream dependencies.

Can't find 'MySql.Data.MySqlclient' class - this comes from ADO.NET interface within SQL Assistant when it's unable to load the specified class. The error is kind of generic, it's returned when .NET reports failure on driver class loading. MySql.Data.MySqlclient class is in MySql.Data.dll which has a bunch of dependencies. Typically a downstream error is like “Could not load file or assembly MySql.data” which can happen if the client is not installed (which is not your case) or there are multiple conflicting versions of the MySQL ADO driver or its dependencies in the global .NET assemblies cache. If you experience this issue again, please try reinstalling MySQL ADO.NET Connector, that should update ADO.NET registration in the global .NET assemblies cache (GAC in short).


Unable to connect to any of the specified MySQL hosts - this comes from the driver, when it gets loaded successfully but doesn't like the connection parameters provided.
https://stackoverflow.com/questions/17993657/unable-to-connect-to-any-of-the-specified-mysql-hosts-c-sharp-mysql/17994855
Thu Jul 22, 2021 10:22 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2100

Post Reply with quote
Yes, I thought that would fix it, alas, it didn't. I've uninstalled and reinstalled several different versions of the connector, rebooting after every uninstall and after every reinstall to make sure no residue can interfere. The funny thing is that it fixed itself without me doing anything intentional at all.

That's why I said I hate these things. I still won't know what to do if it happens again. Putting the machine to sleep, going home, and applying a gentle amount of VPN before trying to connect again smells like "snake oil" :)
Thu Jul 22, 2021 2:25 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7833

Post Reply with quote
May I ask you to try something else next time you see that issue? Please try starting the editor in Run as Administrator mode. That would make windows launch it differently, different User Account Control behavior, different search path, different file virtualization, etc... Please check if that makes any difference.
Fri Jul 23, 2021 9:59 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2100

Post Reply with quote
SysOp wrote:
May I ask you to try something else next time you see that issue? Please try starting the editor in Run as Administrator mode. That would make windows launch it differently, different User Account Control behavior, different search path, different file virtualization, etc... Please check if that makes any difference.


I'll definitely try that one, thanks for the hint. Though I hope never to see that error message again (well, what are the odds of that, right?).
Fri Jul 23, 2021 1:07 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2100

Post Reply with quote
And here we are again. I'm also quite a bit confused.

The connector that I had installed was mysql-connector-not-8.0.30. It didn't work. I recall (but am not sure) that the previous version that worked was 8.0.28.0. It was downloaded from here: https://dev.mysql.com/downloads/connector/net/

When searching for the installer to download so that I can reinstall it, I've run into another source to download from, here: https://www.nuget.org/packages/MySqlConnector/ This one also states that it is an ADO.NET data provider for MySQL and was last updated 10 days ago. But it is version 2.1.13. I've installed and removed and reinstalled both of these several times without any success. Which one (if any) of these is at least expected to work on a MariaDB 5.5.57?
Mon Sep 05, 2022 8:11 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7833

Post Reply with quote
Do you need specifically ADO.NET connection type? If you need an older version, you can find it here https://downloads.mysql.com/archives/c-j/

There is a native connection available for MariaDB with libmariadb client driver preinstalled with SQL Assistant.
Mon Sep 05, 2022 10:21 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2100

Post Reply with quote
SysOp wrote:
Do you need specifically ADO.NET connection type? If you need an older version, you can find it here https://downloads.mysql.com/archives/c-j/

There is a native connection available for MariaDB with libmariadb client driver preinstalled with SQL Assistant.


Yes, I do. ODBC and native connections cannot execute $$...$$ macros containing multiple statements, they both complain about the "right" syntax. For some unknown reason, ADO.NET can. I had to reinstall 8.0.28. It seems that newer versions no longer support connecting to servers with such ancient version numbers as 5.5.57 :( The best they can do is 5.6 and above.
Tue Sep 06, 2022 4:33 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.