Search code examples
mysqlfiredacdelphi-11-alexandria

Delphi 11.1's FireDAC and MySQL: SSL connection error: unknown error number


Ok, I've spent all day on this, and I am stuck, so I'm going to ask for help.

I previously installed Delphi 11 Enterprise in a virtual machine, and also installed MySQL 8.0.27 (64-bit). After obtaining some 32-bit MySQL dlls I was able to easily connect to my database using the FireDAC MySQL driver and from the Data Explorer in the Delphi IDE.

I have now created a new VM and installed both Delphi 11.1 Enterprise and MySQL 8.0.28. After exporting my database from the previous VM, and importing it into this new MySQL server, I tried to attach to the database using FireDAC. Using the same parameters as in the last VM, and the same dlls copied to C:\Windows\SysWOW64, testing the connection fails and produces the following error:

[FireDAC][Phys][MySQL] SSL connection error: unknown error number

I've compared the parameters for connecting to the two databases between the two VMs, and they are the same. And, the connections in MySQL to the two databases also appear to be the same.

One thing that is odd (and I think I know why) is that in the VM where the connection fails, if I view the Info tab of the FireDAC Connection Editor, it says it is using libmysql.dll in the c:\Windows\System32 folder (there's no such file in that folder). But that is also true from the Connection Editor in the VM where FireDAC successfully connects, so I am assuming that System32 is being mapped to C:\Windows\SysWOW64.

If anyone can affirm that they are successfully connecting to MySQL 8... using Delphi 11.1 and FireDAC, and can offer a suggestion for what I need to fix, I will be grateful.

= = = = = = = = = = = = == = = = = = = = =

Update: I've uninstalled MySQL 8.0.28, and reinstalled it using the Development Computer template. I still cannot connect to MySQL using the FireDAC Connection Editor, but I can connect at runtime so long as I employ an FDPhysMySQLDriverLink component, and set the VendorLib property to either libmariadb.dll or libmysql.dll, the 32-bit versions that are stored in the C:\Windows\SysWOW64 folder (thanks Ian Barker for your sample code!). I'm still working on this, since I really want to connect from the IDE, but at least I've had some success.


Solution

  • I have had the same issue today, as part of a whole batch of problems with mysql not running so I updated it and then hit the error above.

    My 64 bit Delphi 10.3 Programs would not connect at all - so I changed the physical driver to libmariadb.dll and that has resolved the issue.