>Robert Gehrig wrote:
>> I am trying to get a small test client written in C to connect to
>>my MySQL server.
>> I am compiling on OS/2 with emx
>> The end executable is called myclnt.exe
>> This what happens when I run the program
>> Init worked
>> Host: 18.104.22.168
>> User: ginger
>> Pwrd: ginger
>> Db: desert_fox
>> <-- I
>>terminated it with a control C
>> Process terminated by SIGINT in thread 1
>> I have include my makefile and the source of my program in this e-mail.
>> Any ideas what I may be doing wrong.
>> If you need any more info about my setup just ask.
>> The make file is as follows:
>> INCLUDES = -I\mysql2\include
>> LIBS = -L\mysql2\lib
>> all: myclnt
>> client.o: client.c
>> $(CC) -c $(INCLUDES) client.c
>> myclnt: client.o
>> $(CC) -O2 -o myclnt.exe client.o $(LIBS) -lmysqlclient -lpthrdrtl
>> Here is my c code:
>> /* Client1.c */
>> #include <stdio.h>
>> #include <mysql.h>
>> MYSQL *conn;
>> int main (int argc, char *argv)
>> char *def_host_name = "22.214.171.124";
>> char *def_user_name = "ginger";
>> char *def_password = "ginger";
>> char *def_db_name = "desert_fox";
>> conn = mysql_init(NULL);
>> if(conn != NULL)
>> printf("Init worked\n");
>> printf("Host: %s\n", def_host_name);
>> printf("User: %s\n", def_user_name);
>> printf("Pwrd: %s\n", def_password);
>> printf(" Db: %s\n", def_db_name);
>> if (mysql_real_connect (
>> conn, /* pointer to connection handler */
>> def_host_name, /* host to connect to */
>> def_user_name, /* user name */
>> def_password, /* password */
>> def_db_name, /* Database to connect to */
>> 0) == NULL) /* flags (none) */
>> printf("Connect Failed\n Error: %u (%s)\n",
>> Robert Gehrig
>> Webmaster at www.gdbarri.com
>> e-mail: webmaster@stripped
>To really know what's going on, I would just trace it in gdb.
>However, I suspect that it hangs in mysql_real_connect because of either DNS
>problems or being unable to contact the server host on port 3306 (
>Can you telnet to port 3306 from the client machine?
A little more information on this one (Robert contacted me, but I don't
know enough about OS/2 to know what to suggest):
- The mysql.exe binary from his distribution can connect to the server okay.
- The program he's trying to compile and run does connect to the server,
because if he runs mysqladmin, it shows the connection, in "unknown"
state (or perhaps "login"). But the connection never successfully
Perhaps some difference between his compiler, and the compiler used to
build the OS/2 binary distribution? I dunno.
Paul DuBois, paul@stripped