JZ fed this fish to the penguins on Friday 28 November 2003 19:15 pm:
I recompiled MySQLdb but I still do not know how to connect to embed
server...
MySQL.Connect(host=...)???? There is no example nor
explanation. Not at all.
Looks like there may be a few extra steps needed... Stuffed into the
MySQLdb build system...
I'm hacking quickly through this book (note that the embedded option
is new with MySQL 4, probably why it hasn't appeared beforehand in this
group).
1 add mysql_embed.h to the set of MySQL header files used...
2 modify the client_groups array... (their example assumes a program
called embapp)
static const char *client_groups[] =
{
"client", "embapp", NULL
};
modify server_groups
static const char *server_groups[] =
{
"server", "embedded", "embapp_SERVER", NULL
}; /* embapp is name of application */
3 call mysql_server_init()
suggested to place just before the mysql_init() call
4 call mysql_server_end()
just after the mysql_close() call
There is also a warning that your application should not be accessing
the same database directory as any other server on the machine.
The mysql_server_* calls are do-nothings if you link with the regular
client library, so once the above is done you can switch back by just
relinking.
--