Q: Problem figuring out versions of DBI

D

David Petrou

Hi. I have a bunch of DBI questions I'm hoping ya'll can help me
with. They are real simple questions, but I'm stymied after searching
the usual channels for answers.

Question #1: I'm trying to figure out what DBD versions I have
installed. But:

% perl -MDBI -e 'DBI->installed_versions'
Can't locate auto/DBI/installed_v.al in @INC (@INC contains: /sw/lib/perl5/5.8.0/darwin /sw/lib/perl5/5.8.0 /sw/lib/perl5/darwin /sw/lib/perl5 /sw/lib/perl5/5.8.0/darwin /sw/lib/perl5/5.8.0 /sw/lib/perl5/site_perl/5.8.0/darwin /sw/lib/perl5/site_perl/5.8.0 /sw/lib/perl5/site_perl .) at -e line 1

i get the same error with a little problem like:

use DBI;
@ver = DBI->installed_versions;
foreach my $item (@ver) {
print "$item\n";
}

I know that I have DBI installed because I use it successfully to work
with a MySQL server.

The reason why I'm trying to figure out my DBI version is so that I
can upgrade, if needed to 2.1022 which is recommended for the version
of MySQL that I have installed.

Question #2: Is there a way to tell DBD::MySQL to look for the MySQL
binaries in a specific place? I want to interact with a remote MySQL
server of version foo, but the MySQL client installed locally in
/usr/local/bin (which I don't have permission to change) is version
bar. I installed version foo in off of ~ and I'd like DBI to use that
stuff.

Question #3: If I install my own DBI, does it come with all the DBD
drivers? Or do I need to hunt down appropriately versioned DBD's for
the databases I'm interacting with?

Thanks much!
dvaid
 
B

Bob Walton

David Petrou wrote:

Question #1: I'm trying to figure out what DBD versions I have
installed. But:

% perl -MDBI -e 'DBI->installed_versions'
Can't locate auto/DBI/installed_v.al in @INC (@INC contains: /sw/lib/perl5/5.8.0/darwin /sw/lib/perl5/5.8.0 /sw/lib/perl5/darwin /sw/lib/perl5 /sw/lib/perl5/5.8.0/darwin /sw/lib/perl5/5.8.0 /sw/lib/perl5/site_perl/5.8.0/darwin /sw/lib/perl5/site_perl/5.8.0 /sw/lib/perl5/site_perl .) at -e line 1

i get the same error with a little problem like:

use DBI;
@ver = DBI->installed_versions;
foreach my $item (@ver) {
print "$item\n";
}

I know that I have DBI installed because I use it successfully to work
with a MySQL server.

The reason why I'm trying to figure out my DBI version is so that I
can upgrade, if needed to 2.1022 which is recommended for the version
of MySQL that I have installed.


FWIW, I get the same error. But I get that same error if I try, for
example:

D:\junk>perl -e "use DBI;print DBI->installed_vexxxons"
Can't locate auto/DBI/installed_v.al in @INC (@INC contains: C:/Perl/lib
C:/Perl
/site/lib .) at -e line 1

D:\junk>

or:

D:\junk>perl -e "use DBI;print DBI->xxxxxxxxx_xxxxxxxx"
Can't locate auto/DBI/xxxxxxxxx_x.al in @INC (@INC contains: C:/Perl/lib
C:/Perl
/site/lib .) at -e line 1

D:\junk>

I note that method installed_versions is not mentioned in the DBI docs.
Where did you get the idea to use it? And what about:

D:\junk>perl -e "use DBD::ODBC;print $DBD::ODBC::VERSION"
1.06
D:\junk>

for example, which is the usual method of determining a module's version?

....
 
J

Juha Laiho

(e-mail address removed) said:
Hi. I have a bunch of DBI questions I'm hoping ya'll can help me
with. They are real simple questions, but I'm stymied after searching
the usual channels for answers. ....
The reason why I'm trying to figure out my DBI version is so that I
can upgrade, if needed to 2.1022 which is recommended for the version
of MySQL that I have installed.

Hmm.. don't know whether this is the correct way, but at least works
for my antique DBI:
perm -MDBI -e 'print $DBI::VERSION;'

.... but then, I took a look through DBI.pm to find out this.
Question #3: If I install my own DBI, does it come with all the DBD
drivers? Or do I need to hunt down appropriately versioned DBD's for
the databases I'm interacting with?

DBI doesn't contain DBDs, so you'll have to pick the ones important
for you. But then, you'll find them at your closest CPAN mirror, so
no hunting needed.
 
J

James Willmore

On 14 Oct 2003 22:16:00 GMT
David Petrou said:
The reason why I'm trying to figure out my DBI version is so that I
can upgrade, if needed to 2.1022 which is recommended for the
version of MySQL that I have installed.

perl -MDBI -e 'print $DBI::VERSION,"\n";'

to get the version of DBI. To get the available drivers, there's a
different method. Read the DBI documentation for more information.
Question #2: Is there a way to tell DBD::MySQL to look for the MySQL
binaries in a specific place? I want to interact with a remote
MySQL server of version foo, but the MySQL client installed locally
in/usr/local/bin (which I don't have permission to change) is
version bar. I installed version foo in off of ~ and I'd like DBI
to use that stuff.

Ouch! You're trying to install DBD::mysql on a machine that does
_not_ have MySQL installed on it? If that's the case, no, it won't
install untill you install the MySQL binaries. You _could_, as a
"workaround", use DBD::proxy. I'm also thinking there's a DBD module
that uses sockets versus the binaries. In other words, the script
opens a connection from the client machine to the MySQL server using
the MySQL port and issues commands directly to the server through that
port. You'll have to check on that (http://search.cpan.org - search
for mysql).
Question #3: If I install my own DBI, does it come with all the DBD
drivers? Or do I need to hunt down appropriately versioned DBD's
for the databases I'm interacting with?

Each different database system has it's own set of drivers. So, yes,
you have to hunt for the proper drivers.

--
Jim

Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.

a fortune quote ...
According to Kentucky state law, every person must take a bath at
least once a year.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top