1 message in com.mysql.lists.win32mysql_init_server returns an error
FromSent OnAttachments
Robert G. Ristroph25 Jul 2005 11:28 
Subject:mysql_init_server returns an error
From:Robert G. Ristroph (rris@airlinksystems.com)
Date:07/25/2005 11:28:39 AM
List:com.mysql.lists.win32

Hi,

I posted this on the Embedded (libmysqld) forum over on the mysql.org forums, but this list seems to get a lot more traffic, so I am posting again here.

I am trying to use embedded mysql from a windows application. I am having trouble getting past the first function I call, mysql_init_server() -- it always returns 1, which is an error.

I made a standalone app and cut-and-pasted (with some modifications) the "example 1" code from here:

http://dev.mysql.com/doc/mysql/en/libmysqld-example.html

I am using Visual C++ 6.0 on Windows XP.

Prior to this, I downloaded the "full installer" version of mysql for windows and installed everything, but did not start the server.

Some things I changed relative to the documentation in the example: 1) I tried adding a "NULL" to the end of the server_groups array, some other examples I found on google had that 2) I opened up my.ini and made sure the server groups were valid names 3) I specified the full path to the my.ini file in server_options 4) I added a message box that pops up and tells me the return value of mysql_server_init().

I have posted a zipped up copy of the whole Visual Studio Project here:

http://rgr.freeshell.org/mysql_embedded/index.html

I can also email it directly if someone needs that.

The .exe is in the debug directory. Note that I copied the libmysqld.dll into that same directory as the .exe in order to run it.

If this code works for you, i.e., the popup says [0] instead of [1], please respond or email me -- I would like to figure out what is different about your computer or settings from mine.

Also, if there is a better forum or mailing list to post this on, please let me know.

--Rob

---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.