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");
>
> >
> >
> >
> >
> > Has anyone tried this. I'm using the 4.0.4 beta
> > source tree.
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Y! Web Hosting - Let the expert host your web site
> > http://webhosting.yahoo.com/
> >
> >
>
---------------------------------------------------------------------
> > 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
> >
>
>
> __________________________________________________
> Do you Yahoo!?
> HotJobs - Search new jobs daily now
> http://hotjobs.yahoo.com/
>
>
---------------------------------------------------------------------
> 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
__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/
---------------------------------------------------------------------
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