Bug #29324 incompatible libwrap?
Submitted: 24 Jun 2007 19:14 Modified: 25 Jun 2007 18:57
Reporter: Carlos Soria Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Server: Embedded Library ( libmysqld ) Severity:S2 (Serious)
Version:mysql Ver 14.12 Distrib 5.0.26, for sus OS:Linux
Assigned to: CPU Architecture:Any

[24 Jun 2007 19:14] Carlos Soria
Description:
Hello,

 I have tried to compile first examples in section 'Embedded Server Examples' of the manual. Trying to compile with 

I get 

/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: cannot find -lwrap
collect2: ld returned 1 exit status

I have checked that libwrap exists in a proper directory. Is there a incompatibility with lwrap?

>gcc --version
gcc (GCC) 4.1.2 20061115 (prerelease) (SUSE Linux)

Thank you.

How to repeat:
Here you have the code 

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include "mysql.h"

MYSQL *mysql;
MYSQL_RES *results;
MYSQL_ROW record;

static char *server_options[] = { "mysql_test", "--defaults-file=my.cnf" };
int num_elements = sizeof(server_options)/ sizeof(char *);
static char *server_groups[] = { "libmysqld_server", "libmysqld_client" };

int main(void)
{
mysql_server_init(num_elements, server_options, server_groups);
mysql = mysql_init(NULL);
mysql_options(mysql, MYSQL_READ_DEFAULT_GROUP, "libmysqld_client");
mysql_options(mysql, MYSQL_OPT_USE_EMBEDDED_CONNECTION, NULL);
mysql_real_connect(mysql, NULL,NULL,NULL, "database1", 0,NULL,0);
mysql_query(mysql, "SELECT column1, column2 FROM table1");
results = mysql_store_result(mysql);
while((record = mysql_fetch_row(results))) {
printf("%s - %s \n", record[0], record[1]);
}
mysql_free_result(results);
mysql_close(mysql);
mysql_server_end();
return 0;
}
[25 Jun 2007 18:57] Sveta Smirnova
Thank you for the report.

But embedded server is not supported in version 5.0 See also http://dev.mysql.com/doc/refman/5.0/en/libmysqld.html

Please use version 5.1 or 4.1