Since version 4.0 MySQL server supports Embedded server. Embedded server is an easy to install server used by applications that do not require multi-user work with MySQL server. For example, Embedded server can be used for money access machines, automatic cash desks, different electronic facilities and so on. Please refer to MySQL Reference Manual for more details on features and using of Embedded server. Also you can find some information about licensing Embedded server in MySQL Reference Manual. Please refer to Embedded Demo for a sample.
MySQL Embedded Server 4.0 should be recompiled to be used in your application.
MySQL Embedded Sever 5.0 is not included into the binary installation pack. Below is a quotation from the MySQL Reference Manual:
"The Embedded MySQL server library is NOT part of MySQL 5.0. It is part of previous editions and will be included in future versions, starting with MySQL 5.1."
That is why we have not tested MyDAC with the MySQL Embedded Sever 5.0.
So, we recommend using MySQL Embedded Server 4.1. As MySQL Embedded Server has some problems working with the InnoDB storage, we recommend disabling this storage engine. You can do this by checking the "Disable InnoDB storage engine" option in the TMyEmbConnection editor on the Params tab. Another way is to add the --skip-innodb parameter to the TMyEmbConnection component manually.
Copy libmysqld.dll file to the folder available for executable file of the application. Please see a detailed description of accessible paths at LoadLibrary description
A typical structure of folders for an application using Embedded Server:
Project.exe - executable file of your application
libmysqld.dll - MySQL Embedded server library
share/english/errmsg.sys - file with MySQL Embedded server messages
data/ - data directory (DataDir). See a structure of this folder in MySQL Reference Manual
data/mysql/ - directory with service data of MySQL (user access rights, and so on) data/DataBase/ - directory with user data. See TCustomMyConnection.DataBase
ln libmysqld.so.14.0.0 libmysqld.so
ln libmysqld.so.14.0.0 libmysqld.so.14
On the start (first opening a connection), MySQL Embedded Server searches for the setting values in the next order:
Usually to set-up Embedded Server it is enough to set basedir and datadir.But sometimes some additional settings are required, for example to disable usingInnoDB engine (--skip-innodb). The detailed list of settings you can find at MySQL Reference Manual.
Pay attention that all paths must be set through "/" but not "\".
Note, parameters names are case-sensitive.
If datadir is located in the read-only storage, then you need to set OnLog andOnLogError event handlers to prevent server from attempts to create log-files in datadir.
Simultaneous access to the same data from several instances of MySQL server (for example, to MySQL server and Embedded server) can be a reason of data loss.