This is the zipped Microsoft Visual C++ 6.0 Project that was made from the example in the mysql documentation: mysql_embedded.zip

Original Message:


Hi,

    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
Back to homepage
Robert G. Ristroph