MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:Andrej van der Zee Date:March 23 2009 10:05am
Subject:connect to remote server in custom background thread
View as plain text  
Hi,

I am trying to connect to a remote server in a custom MySQL background
thread, but it keeps failing. The same piece of code isolated in a
test-program runing from the same host works fine. Also, connecting to
localhost instead of the remote server works fine. Moreover, starting
the mysql client program to connect to the remote database with the
same host+user+pwd works perfectly fine too. This leads me to believe
that there is some internal setting for the mysql server that prevents
me from connecting to a remote database. Please help!

This is the code I am using to connect.

    conn = mysql_init(NULL);
    if (!mysql_real_connect(conn, "mbrace3", "mbrace", "mbrace",
"mbracelog", 0, "/var/run/mysqld/mysqld.sock", 0))
    {
      general_log_print(thd, COM_MBRACE, "Failed to connect to
mbracelog database: %s", mysql_error(conn));
      exit(0);
    }

Thank you!
Andrej
Thread
connect to remote server in custom background threadAndrej van der Zee23 Mar
  • Re: connect to remote server in custom background threadSergei Golubchik25 Mar
    • Re: connect to remote server in custom background threadAndrej van der Zee25 Mar