TMyConnection embedded

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
andrea.m86
Posts: 25
Joined: Thu 26 May 2011 10:36

TMyConnection embedded

Post by andrea.m86 » Thu 26 May 2011 10:44

Hi!
I need to connect to a MySQL Embedded Server with TMyConnection (I don't want to use TmyembConnection)
Is there a way to set the basedir and datadir parameters?
How can i refer to my directories?
Thanks!

AndreyZ

Post by AndreyZ » Thu 26 May 2011 13:01

Hello,

To work with Embedded MySQL server using the TMyConnection component, you should set the TMyConnection.Options.Embedded option to True. The basedir and datadir parameters can be set in the [mysqld] section of the my.ini file. Note that you should also place the libmysqld.dll library to the System directory, or to the root directory of your application.

andrea.m86
Posts: 25
Joined: Thu 26 May 2011 10:36

Post by andrea.m86 » Thu 26 May 2011 14:18

It still doesn't work...
Where should i put my.ini and libmysqld?

andrea.m86
Posts: 25
Joined: Thu 26 May 2011 10:36

Post by andrea.m86 » Thu 26 May 2011 15:00

My application always search for directories 'data' and 'share' in the parent directory of the .exe ! How can i change that? Thanks..

AndreyZ

Post by AndreyZ » Fri 27 May 2011 09:28

To solve the problem, you should place the my.ini file to the Windows directory (for example, C:\Windows).

andrea.m86
Posts: 25
Joined: Thu 26 May 2011 10:36

Post by andrea.m86 » Fri 27 May 2011 11:02

I also tried this.. but i didn't get any result.. TMyConnection doesn't seems to read my.ini in any case..

AndreyZ

Post by AndreyZ » Fri 27 May 2011 14:26

To solve the problem, you should add the [embedded] section to the my.ini file, and set the basedir and datadir parameters in this section. Here is an example:

Code: Select all

[embedded]
basedir="D:/Program Files/MySQL/MySQL Server 5.5/"
datadir="D:/Program Files/MySQL/MySQL Server 5.5/Data/"

andrea.m86
Posts: 25
Joined: Thu 26 May 2011 10:36

Post by andrea.m86 » Fri 27 May 2011 14:47

Ok! Solved!

Post Reply