Page 1 of 1
[Embedded Server] Specify config params for embedded server
Posted: Mon 25 Aug 2008 09:31
by fduenas
Hi In latets builds i have tried to specify startup params for the dbxMDA Mysql Embedded server, using the Params property of the TSQLconnection or with the my.ini|my.cnf in executables folder but it seems it doesn't read the startup config. This is needed for example to specify the default language, chartsets, working data folder, base dir, disable innodb, etc.
How can this be achieved?
Posted: Wed 27 Aug 2008 11:59
by Dimon
You should use the TCRSQLConnection component instead of TSQLConnection.
For quick converting TSQLConnection in TCRSQLConnection you can use the "Convert to TCRSQLConnection" menu of component pop-up menu.
Posted: Sat 06 Sep 2008 19:28
by fduenas
So doing doing this will make that i can configure the embedded server? for example read the my.ini or my.cfg file residing in the excutable path so i can specify the BaseDir, DataDir, and Charsets folder system variable needed to start the embedded server?
I normally don't use the TSQLConnection, or any DBX express bative components, normally I use the AnyDAC Data Access components and use the DBX bridge using your driver. Is there a way I can specify to your DBX driver to use the my.ini file to read startup variables or please show me a way how to achieve this.
Thanks.
Posted: Mon 08 Sep 2008 12:49
by Dimon
You can not specify the parameters of the Embedded connection using dbExpress driver. For this you should use the TMyEmbConnection component of MyDAC.
To specify parameters in the my.ini configuration file this file must be placed in the {Windows} directory.
Posted: Thu 11 Sep 2008 23:00
by fduenas
Ok. So I understand if I want to use embedded connection with custom parameters using DbExpress connection i must put my.ini in the windows folder.
I think you should add a suggestion for enabling the driver to search first for a my.ini found on the same folder as the exe or dll, and then search in the windows folder, doing this we can have my.ini for each different application.
I think it can be a very functional suggestion and not difficult to be implemented by you.
Posted: Mon 15 Sep 2008 07:20
by Dimon
We will investigate the possibility of adding this functionality in the near future.
Posted: Thu 27 Nov 2008 08:16
by Dimon
Now a feature for setting the 'Params' option to specify the list of command line parameters for MySQL Embedded server is added in DbxMda. For this you should set the appropriate parameter of TCRSQLConnection, like this:
Code: Select all
TCRSQLConnection.Params.Values['Custom String'] := 'Params="--basedir=.'#13#10'--datadir=data"';
Note: besides other parameters, you can set the --basedir and --datadir parameters.
The --basedir parameter sets the base path for MySQL Embedded server. All paths are usually resolved relative to this.
The --datadir parameter sets the path to the data directory.
See MySQL Reference Manual for detailed description.
embedded MySQL parameters
Posted: Tue 20 Jan 2009 15:47
by AngelusB
I'm using Delphi2007 and driver DevartMySQLEmbedded (driver 4.40.13 12-Dec-08)
If I use "my.in" in "c:\windows" (as in C:\Program Files\Devart\DbxMda\Demos\Win32\Embedded), all is working perfect.
But I try to prevent my customers to install files in c:\windows (Vista problems), so I tried to use parameter settings in the TCRSQLConnection.
My "basedir" is the application's directory. "datadir" is a subdirectory of "basedir".
Before connecting to the database I have the code:
MyConnection.Params.Values['Custom String'] := 'Params="--basedir=.'#13#10'--datadir=data"';
But this doesn't work. The error message is something like '
A call to an mysql_server_init failed.
c:\mysql\share\english.sym - System can't find the path
etc.
What's wrong?
Posted: Wed 21 Jan 2009 13:04
by Dimon
Please make sure that you have privileges to create files in the data and data\database_name directories.
Posted: Wed 21 Jan 2009 15:22
by AngelusB
Dimon wrote:Please make sure that you have privileges to create files in the data and data\database_name directories.
I'm very sure that I have all privileges to that directories.
Something must be wrong with the syntax of the parameters. When I create the directory c:\mysql c:\mysql\data and c:\mysql\share etc. all is working perfect. So I guess the parameter string is incorrect. Did I use the right syntax?
Posted: Fri 23 Jan 2009 07:12
by Dimon
Please specify the exact version of your Embedded server.
Posted: Mon 26 Jan 2009 15:00
by AngelusB
It's a libmysqld.dll without version number, dated 2005-3-24. (3444 Kb).
I downloaded this file some time ago.
And now the good news:
I made a new download from
http://www.dlldll.com/downdll/3057.html and that solved the problem. Everything is working fine now.
Thank you pointing my attention to the embedded server version.
Posted: Tue 27 Jan 2009 09:47
by Dimon
It is good to see that this problem has been solved.
Posted: Mon 02 Feb 2009 08:09
by fduenas
Its good to see there are ways to specify params for the mebedded server, now can there be a say to specify to use the my.ini file for configuration?, maybe also espeifying a param like:
params=--defaults-file=my.ini so paramaters can be taken by a configuration file.
In MySQL documentation it says membeddeds server can manage parametrs speciffied in [server]and [embedded] sections in the ini file.
Posted: Mon 02 Feb 2009 13:18
by Dimon
You are right. To specify a configuration file you should set the defaults-file option of TCRSQLConnection, like this:
Code: Select all
TCRSQLConnection.Params.Values['Custom String'] := 'Params="--defaults-file=my.ini"';