not sure if this applies here, its from the c++ api docs (but why switch it around)
Do you have the parameters sent in the right order?

  // The full format for the Connection constructor is 
  // Connection(cchar *db, cchar *host="", 
  //            cchar *user="", cchar *passwd="") 

I really know nothing about the c, c++ api's, just trying to help

> -----Original Message-----
> From: Steven Webb [mailto:scumola@;yahoo.com]
> Sent: Tuesday, November 05, 2002 3:58 PM
> To: Black, Kelly W [PCS]; Mysql list
> Subject: RE: using libmysqld - can't connect to remote DB as client.
> 
> 
> I am.  See the original post:
> 
> > >   // Here's the remote connection - it connects to
> > > the
> > > same local machine, not the remote machine.  
> > >   two = db_remote_connect
> > > ("remote_machine","remote","remote","dbname");
> > >   db_do_query(two, "SHOW DATABASES");
> 
> --- "Black, Kelly W [PCS]"
> <[EMAIL PROTECTED]> wrote:
> > So use the C syntx instead.
> > 
> > :)
> > 
> > -----Original Message-----
> > From: Steven Webb [mailto:scumola@;yahoo.com]
> > Sent: Tuesday, November 05, 2002 12:21 PM
> > To: Black, Kelly W [PCS]; Mysql list
> > Subject: RE: using libmysqld - can't connect to
> > remote DB as client.
> > 
> > 
> > Ok, but I'm writing this in C, not perl.
> > 
> > - Steve
> > 
> > --- "Black, Kelly W [PCS]"
> > <[EMAIL PROTECTED]> wrote:
> > > I think your problem might be here ->
> > > 
> > > you have db_connect("my_blah_database");
> > > Try using something like
> > > 
> > > my $dbh =
> > DBI->connect("DBI:mysql:$dbname:hostname",
> > > $dbuser, $dbpasswd) ||
> > > die "can't connect: $DBI::errstr\n";
> > > 
> > > Also make sure you include the || die "can't
> > > connect: $DBI::errstr\n";
> > > as in this way you can get some useful error
> > output
> > > about the connect.
> > > 
> > > Not certain but at least I am trying to help :) 
> > > 
> > > Oh and don't forget sql query! :)
> > > 
> > > ~Kelly W. Black
> > > 
> > > 
> > > -----Original Message-----
> > > From: Steven Webb [mailto:scumola@;yahoo.com]
> > > Sent: Tuesday, November 05, 2002 11:20 AM
> > > To: Mysql list
> > > Subject: Re: using libmysqld - can't connect to
> > > remote DB as client.
> > > 
> > > 
> > > Still nobody has answered my question.
> > > 
> > > Has anyone here even tried linking with
> > libmysqld.a
> > > before?
> > > 
> > > - Steve
> > > 
> > > --- Steven Webb <[EMAIL PROTECTED]> wrote:
> > > > Nobody answered my question, so I felt like I
> > > should
> > > > ask again ...
> > > > 
> > > > I'm using libmysqld to embed a mysql server in
> > my
> > > C
> > > > app.  However, I'd also like to connect to other
> > > > remote mysql databases as well, but the
> > > > "mysql_real_connect" command doesn't seem to be
> > > > working when trying to connect to a remote
> > > database
> > > > in
> > > > the same app as the libmysqld stuff.  The
> > connect
> > > > works, but I think that it's connecting to my
> > > local
> > > > database and not the remote one.  Here's a
> > little
> > > > code:
> > > > 
> > > >   mysql_server_init(sizeof(server_args) /
> > > > sizeof(char
> > > > *), server_args, server_groups);
> > > > 
> > > >   // Here's the embedded database.  This works.
> > > >   one = db_connect(NULL);
> > > >   db_do_query(one, "CREATE DATABASE
> > > > my_blah_database");
> > > >   mysql_close(one);
> > > >   one = db_connect("my_blah_database");
> > > >   db_do_query(one, "create table blank (num
> > > int)");
> > > >   mysql_close(one);
> > > > 
> > > >   /* This must be called after all other mysql
> > > > functions */
> > > >   mysql_server_end();
> > > > 
> > > >   // Here's the remote connection - it connects
> > to
> > > > the
> > > > same local machine, not the remote machine.  
> > > >   two = db_remote_connect
> > > > ("remote_machine","remote","remote","dbname");
> > > >   db_do_query(two, "SHOW DATABASES");           
> >  
> 

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to