[Embedded Server] Specify config params for embedded server
[Embedded Server] Specify config params for embedded server
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?
How can this be achieved?
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.
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.
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.
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.
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:
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.
Code: Select all
TCRSQLConnection.Params.Values['Custom String'] := 'Params="--basedir=.'#13#10'--datadir=data"';
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
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?
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?
I'm very sure that I have all privileges to that directories.Dimon wrote:Please make sure that you have privileges to create files in the data and data\database_name 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?
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.
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.
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.
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.
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"';