0

I have a little different question from Delphi XE5 FireDAC Error: Cannot load vendor library libmysql.dll or libmysqld.dll

I'm evaluating Delphi XE6 on Windows 7 64bit, I wish to use FireDAC to connect to MySQL database.

I have downloaded libmysql.dll and install the file in C:\Windows\SYSTEM32\.

After trying to set TFDConnection.Active to true during designed time, I got error dialog as displayed below.

enter image description here

So I tried to use TFDPyhsMySQLDriverLink, I have set TFDPyhsMySQLLink.VendorLib to C:\Windows\System32\libmysql.dll, and set TFDConnection.DriverName to point to TFDPyhsMySQLLink.DriverID instead, but I got error dialog as displayed below.

enter image description here

I have tried to place libmysql.dll at C:\Windows\System32\bin but the error dialog still the same as displayed above.

Please guide me what to do to fix this problem.

Community
  • 1
  • 1
Artisan
  • 4,042
  • 13
  • 37
  • 61
  • 3
    The Delphi IDE is 32-bit and you stored the library into 64-bit system folder. – TLama May 29 '14 at 18:27
  • Where should I place the libmysql.dll(64bit) to?, I found a comment on other related question mention about `C:\Windows\SysWOW64\` so I tried to put the file there too but it was not working. – Artisan May 29 '14 at 18:36
  • 1
    The library must be 32-bit. That's what the error message tells you. Try to do [`what Sir Rufo suggests`](http://stackoverflow.com/questions/21857209/delphi-xe5-firedac-error-cannot-load-vendor-library-libmysql-dll-or-libmysqld#comment33089642_21857209). – TLama May 29 '14 at 18:41

2 Answers2

3

With carefully reading this comment and this comment

There are a few facts to fix the problem. - Delphi IDE is a 32 bit application so I need libmysql.dll (32 bit version) instead of 64 bit version. - libmysql.dll version not depending on the MySQL server itself as I used to misunderstood - C:\Windows\SysWOW64 is equivalent to C:\Windows\System32 but it's the place to store system dll for the 32 bit Application (like Delphi)

So I've placed the libmysql.dll (32 bit version) at C:\Windows\SysWOW64, finally the problem is fixed.

Community
  • 1
  • 1
Artisan
  • 4,042
  • 13
  • 37
  • 61
  • 2
    Just one word about connecting to a database at design time. It's very annoying to open projects that expect to have a working access to some database hardcoded at design-time (left active when saving the project). I would personally avoid connecting to DB at design time completely, or at least write a big sticky note to not forget to turn the `Active` property to False before saving the project when doing so. But maybe it's better these days, I don't know... I still prefer to make all the DB bindings at runtime due to easier maintainability. – TLama May 29 '14 at 21:03
  • Nice! what about `libmysqld.dll` file? – Yousha Aleayoub Oct 03 '16 at 18:37
0

xampp

C:\xampp\mysql\lib\libmysql.dll 
C:\xampp\mysql\lib\libmysqld.dll

COPY TO

C:\Program Files (x86)\Embarcadero\RAD Studio\XX.X\bin

k.bon
  • 386
  • 2
  • 9