develooper Front page | perl.dbi.users | Postings from February 2001

DBD::MySQL _ListDBs function for 3.23

Thread Next
From:
Mike Ford
Date:
February 16, 2001 09:00
Subject:
DBD::MySQL _ListDBs function for 3.23
Message ID:
3A8D5876.DDB886F0@wfiinc.com
I was doing some tests last night and I wanted to compare the databases
on two servers.  First I wanted to ensure that the databases were
defined on both systems and to only transfer those that were not on the
second server from the first server.

Using the following:

$drh = DBI->install_driver("mysql");
@dbs = $drh->func("localhost:3306", '_ListDBs');
@dbs_2 = $drh->func("192.168.0.1:3306", _ListDBs');

print join ", ", @dbs;
print "\n";
print join ", ", @dbs_2;
print "\n";

the result was 2 blank lines.

The POD says that _ListDBs is useful since DBI->data_sources("mysql")
will only show for localhost.  When I replaced the localhost line above
with the data_sources command, it provided the list for the local
system.  I figured that $drh wasn't initialized, but I threw in a
command to see if $drh contained anything, and it was indeed a blessed
reference.  Does anyone know why _ListDBs doesn't work as described in
the POD?
-- 
Mike Ford
Web Developer, WorkFlow Integrators, Inc.
mike@wfiinc.com
www.wfiinc.com

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About