Delphi Application - Conversion to Embedded MySQL

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
grahamarsden
Posts: 1
Joined: Fri 27 Jul 2018 21:55

Delphi Application - Conversion to Embedded MySQL

Post by grahamarsden » Sat 28 Jul 2018 00:03

I have a Delphi XE2 application which currently connects to a MySQL 5.5 database sever.
To convert this application to using MySQL embedded ie libmysqld.dll I have followed these steps ...

On the main form the TMyConnection component has been replaced with a TMyEmbConnection with the new settings for data locations and the installation set up as described at ... https://www.devart.com/dotconnect/mysql ... erver.html but adapted to the Delphi language. The MySQL server service has been stopped.
When the application runs there is an error message ...
"A call to an mysql_server_init failed.
C:\Users\<username>\AppData\Roaming\MySQL\.mylogin.cnf - The system cannot find the file specified"

I cannot find any mention of this cnf file being required or how to set it up.
It seems superfluous as all the server connection details are provided in the TMyEmbConnection component.
Can anyone assist with getting this running.
Thanks

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Delphi Application - Conversion to Embedded MySQL

Post by ViktorV » Mon 30 Jul 2018 10:54

MyDAC doesn't deploy any MySQL Embedded server library. To work with the Embedded server you should copy needed 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 supplied with MySQL server.
To solve the issue try setting the MySQLEmbDisableEventLog variable to True in the initialization section of one of the units in your project.

Code: Select all

initialization
  MySQLApi.MySQLEmbDisableEventLog := True;
Note that to run this code, you should add the Uni and MySQLApi unit to the USES clause of your unit.

Post Reply