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

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:WindowsSystem32 folder (which is PATH location), but when I tried to Connect from the IDE,

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.

3

6 Answers

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

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.

  • Download from: https://dev.mysql.com/downloads/connector/c/
  • libmysql.dll copy to: C:\Program Files (x86)\Embarcadero\RAD Studio\12.0\bin
  • 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 

    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 

    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.

    1

    ncG1vNJzZmirpJawrLvVnqmfpJ%2Bse6S7zGiorp2jqbawutJoaWpwZWx%2FcYWOnZylqJieermxlGadoqqVma6kecSrqaiqXZiur7rOrWSlp5GZerexzZ2mq2Wcnq%2BzrdGyZKWhkqLGtL3LZpulpF2kv264yJuksquhobE%3D

     Share!