Page 1 of 1

TMyConnection embedded

Posted: Thu 26 May 2011 10:44
by andrea.m86
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!

Posted: Thu 26 May 2011 13:01
by AndreyZ
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.

Posted: Thu 26 May 2011 14:18
by andrea.m86
It still doesn't work...
Where should i put my.ini and libmysqld?

Posted: Thu 26 May 2011 15:00
by andrea.m86
My application always search for directories 'data' and 'share' in the parent directory of the .exe ! How can i change that? Thanks..

Posted: Fri 27 May 2011 09:28
by AndreyZ
To solve the problem, you should place the my.ini file to the Windows directory (for example, C:\Windows).

Posted: Fri 27 May 2011 11:02
by andrea.m86
I also tried this.. but i didn't get any result.. TMyConnection doesn't seems to read my.ini in any case..

Posted: Fri 27 May 2011 14:26
by AndreyZ
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/"

Posted: Fri 27 May 2011 14:47
by andrea.m86
Ok! Solved!