Delphi XE5 FireDAC Error: Cannot load vendor library [libmysql.dll or libmysqld.dll]
Asked Answered
T

7

5

I'm using Delphi XE5 on Windows 7 64bit and just trying FireDAC component. I'm using one TFDConnection component to connect to local MySQL database (v5.6.15).

I already put the libmysql.dll (32bit v5.6.15) into my Project folder, the EXE folder and C:\Windows\System32 folder (which is PATH location), but when I tried to Connect from the IDE, I encountered an error:

Cannot load vendor library [libmysql.dll or libmysqld.dll]. THe system cannot find the file spcified. Hint: check it is in the PATH or application EXE directories, and has x86 bitness..

I also tried to put the libmysql.dll (64bit v5.6.15) to all those three folders, but still encounter the same error.

Do I miss something to make it connected? Thank you for the help.

Therapeutic answered 18/2, 2014 at 14:46 Comment(3)
The IDE is 32bit and the libmysql.dll (32bit) should be located in "%systemroot%\SysWOW64" on 64bit OSOiler
Try to set TFDPhysMySQLDriverLink.VendorLib property to the full path of libmysql.dll and see what the message you will get or the app will connect.Rivard
I see! After I add TFDPhysMySQLDriverLink.VendorLib property, now I can connect to the database. Does that mean the TFDConnection cannot connect by itself and need to use TFDPhysMySQLDriverLink component?Therapeutic
T
3

Try to set TFDPhysMySQLDriverLink.VendorLib property to the full path of libmysql.dll and see what the message you will get or the app will connect

Tried the solution based on da-soft comment above, and It works well. Thanks

Therapeutic answered 16/2, 2016 at 9:23 Comment(0)
S
2
  1. Download from: https://dev.mysql.com/downloads/connector/c/
  2. libmysql.dll copy to: C:\Program Files (x86)\Embarcadero\RAD Studio\12.0\bin
Schwarz answered 4/5, 2015 at 19:12 Comment(0)
I
2

Don't copy dll files to the bin directory as suggested by some others answers. This could potentially interfere with the copy protection mechanism and cause your IDE to vanish without warning, and could upset the license.

Copy the dll files to another location on your path which the IDE (and/or your app) can see.

Integrate answered 28/5, 2018 at 4:57 Comment(0)
Z
1

xampp

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

COPY TO

C:\Program Files (x86)\Embarcadero\RAD Studio\12.0\bin
Zouave answered 16/7, 2014 at 17:26 Comment(0)
G
1

Had this same problem trying to connect FireDAC to mysql on Berlin 10.1

Mysql managed by WAMPserver64 on a 64-bit Window 10 machine. So I have libmysql.dll {64-bit} located in my WAMP mysql bin folder. Downloaded mysql-connector-c-6.1.6-win32.zip from https://dev.mysql.com/downloads/connector/c/ and put libmysql.dll {32-bit} in SysWOW64, as suggested by NoName

Added the following lines into FDDrivers.ini

[MySQL]
BaseDriverID=MySQL
VendorLibWin32=c:\Windows\SysWOW64\libmysql.dll
VendorLibWin64=c:\wamp64\bin\mysql\mysql5.7.14\lib\libmysql.dll
Gunner answered 24/12, 2016 at 4:4 Comment(0)
T
1

Also experienced the problems described above with Seattle, connecting to a local and remote 64-bit version of MySQL.

Neither placing the 32-bit version of libmysql.dll (obtained from same source as NoName above) in the exe directory or setting the VendorLib property worked.

However, due to an exception thrown on a Windows 7 machine that advised it was unable to load VCRuntime140.dll, I found a copy and placed it in the same directory as libmysql.dll, and this worked.

All I could find about VCRuntime140 online, is it is used by MS Visual Studio. Copies found on machines I've performed a search on, have been in directories belonging to DropBox (this is the one I copied) and OneDrive. I could not find an online resource that satisfactorily explained why it worked or why it would be needed.

Testa answered 13/7, 2017 at 23:9 Comment(1)
I wasted 3 hours before trying your "kinda random" advice. It worked. Thanks a lot, dudeRaisaraise
M
0

I had the same problem with copying database files from my old PC to my new PC. The solution was use Back-up (to a USB drive) from the application on the old PC then open the application on the new PC and select restore from the USB drive.

Morgue answered 31/3 at 3:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.