Search code examples
mysqldelphidelphi-xewindows-10firedac

FireDac error 314 - but DLLs are in program directory


I am getting when trying to access a MySql database :

[FireDac][Phys][MySQL]-314. Cannot load vendor library [libmysql.dll or libmysqlld.dll]

This did not previously happen with this (unchanged) code, however, I have upgraded to Windows 10 and had to reinstall Delphi XE8, so it is obviously a system configuration matter.

In order to try to solve the problem, I copied both of those files into c:\windows\sysytem32.

When that did not seem to work, I copied them into \win32\debug, which is where the generated .EXE resides.

I imagine that I am doing something rather stupid, but can't see what.


Solution

  • The proper solution is to place the driver file (eg., libmysql.dll) in your application's folder, or to place the installation location in your FDDrivers.ini file:

    [MySQL]
    Vendor=<folder>\libmysql.dll
    

    (Recent versions of the documentation seem to use VendorLib instead of Vendor in the INI file.)

    See the RAD Studio documentation topics Configuring Drivers (FireDAC) and Connect to MySQL Server (FireDAC) for more information.