MySQL Forums
Forum List  »  Source, Builds, Binaries

Re: How to compile the libmysqld.dll from the source code?
Posted by: Jim Babcock
Date: April 27, 2007 07:09AM

We just purchased MySQL to deeply embed it in a C++ application. I am confused by your message. I was told by your salesperson and the MySQL Enterprise that I downloaded includes what appears to be required to embed version 5.0. Please clarify.

Additionally, I have been unable to build and execute any of the samples or demos I find on this site or any other. With the following code:

#include "mysql.h"
MYSQL *mysql; //the embedded server class
MYSQL_RES *results; //stores results from queries
MYSQL_ROW record; //a single row in a result set
static char *server_options[] = {"mysql_test",
"--defaults-file=c:\\mysql_embedded\\my.ini",
"--datadir=c:\\mysql_embedded\\data" };
int num_elements=sizeof(server_options) / sizeof(char *);
static char *server_groups[] = {"libmyswld_server", "libmysqld_client" };
int main(void)
{
if (mysql_server_init(num_elements, server_options, server_groups)) {
printf("There was an error! Error number : %d = %s\n",
mysql_errno(mysql), mysql_error(mysql));
}
if(!(mysql = mysql_init(NULL))) {
printf("There was an error! Error number : %d = %s\n",
mysql_errno(mysql), mysql_error(mysql));
}
mysql_options(mysql, MYSQL_READ_DEFAULT_GROUP, "libmysqld_client");
mysql_options(mysql, MYSQL_OPT_USE_EMBEDDED_CONNECTION, NULL);
if (mysql_real_connect(mysql, NULL, NULL, NULL, "information_schema",
0, NULL, 0)) {
printf("There was an error! Error number : %d = %s\n",
mysql_errno(mysql), mysql_error(mysql));
}

if (mysql_query(mysql, "SHOW DATABASES;")) {
printf("There was an error! Error number : %d = %s\n",
mysql_errno(mysql), mysql_error(mysql));
}

I get an error 2006, MySQL server has gone away from the query function. Any suggestions would be very helpful.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: How to compile the libmysqld.dll from the source code?
2003
April 27, 2007 07:09AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.