Aleksandar
Aleksandar

Reputation: 48

Delphi and UniDAC embedded MySQL connect string

I have a problem with connecting Devart UniDac with embedded mySQL database.

The code goes:

basedir := GetCurrentDir + '\mysql';
UniConnection1.ProviderName := 'MySQL';
UniConnection1.Database := 'razrednici';
UniConnection1.SpecificOptions.Values['Embedded'] := 'True';
UniConnection1.SpecificOptions.Values['EmbeddedParams'] := '--basedir=' +
  basedir + ''#13#10'--datadir=data';
UniConnection1.Connect;

but i get an error message of some files missing, i have the database in ./mysql/data/razrednici i have a share folder along with data folder and libmysqld.dll with the exe file... what is missing? help me out

Upvotes: 0

Views: 1370

Answers (1)

Devart
Devart

Reputation: 122042

To work with the Embedded server you should copy the required libmysqld.dll and the "Share" directory from the MySQL server directory to the directory with your application.

This library is different for 32-bit and 64-bit application and it is distributed with MySQL Server.

The libmysqld.dll and share\english\errmsg.sys files are distributed with MySQL Server distribution of the corresponding bitness.

Note, both 32-bit and 64-bit client libraries of the MySQL Embedded Server library are called the same - libmysqld.dll and each of them is distributed with the distribution of the corresponding bitness.

It is enough to place libmysqld.dll in the same directory of the used file.

Also try to use in your sample the following code:

UniConnection.SpecificOptions.Values['EmbeddedParams'] := '--basedir=.'#13#10'--datadir=data';

Upvotes: 0

Related Questions