[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] DBI/DBD Perl Modules and mySQL



> How can I tell if the DBI/DBD modules for Perl are installed on a system?
> When trying to access a mySQL DB through Perl using these modules, I keep
> getting an error... I'm not sure what they are, or where to get them for
> installation..

Get them from the MySQL FTP site (ftp.mysql.com).

Here are the installation instructions from the Msql-Mysql DBD readme file
(which, obviously, you can't get until you have got the DBD module
downloaded, so I thought I would just post them here verbatim (sorry if they
are deemed to be too long for list transmission)

INSTALLATION
    Windows users may skip this section and pass over to the WIN32
    INSTALLATION entry elsewhere in this document below. Others, go on
    reading.

    First you need to install the DBI module. For using *dbimon*, a simple
    DBI shell it is recommended to install Data::ShowTable another Perl
    module.

    I recommend trying automatic installation via the CPAN module. Try

      perl -MCPAN -e shell

    If you are using the CPAN module for the first time, it will prompt you
    a lot of questions. If you finally receive the CPAN prompt, enter

      install Bundle::DBD::mSQL

    or

      install Bundle::DBD::mysql

    If this fails (which may be the case for a number of reasons, for
    example because you are behind a firewall or don't have network access),
    you need to do a manual installation. First of all you need to fetch the
    archives from any CPAN mirror, for example

      ftp://ftp.funet.fi/pub/languages/perl/CPAN/modules/by-module

    The following archives are required (version numbers may have changed, I
    choose those which are current as of this writing):

      DBI/DBI-1.13.tar.gz
      Data/Data-ShowTable-3.3.tar.gz
      DBD/Msql-Mysql-modules-1.2217.tar.gz

    Then enter the following commands:

      gzip -cd DBI-1.13.tar.gz | tar xf -
      cd DBI-1.13
      perl Makefile.PL
      make
      make test
      make install

      cd ..
      gzip -cd Data-ShowTable-3.3.tar.gz | tar xf -
      cd Data-ShowTable-3.3
      perl Makefile.PL
      make
      make install  # Don't try make test, the test suite is broken

      cd ..
      gzip -cd Msql-Mysql-modules-1.2217.tar.gz | tar xf -
      cd Msql-Mysql-modules-1.2217
      perl Makefile.PL
      make
      make test
      make install

    During "perl Makefile.PL" you will be prompted some questions. In
    particular you have to choose the installed drivers (MySQL, mSQL2 and/or
    mSQL1). The MySQL driver will be called DBD::mysql, a single mSQL driver
    will be called DBD::mSQL. If you want to support both mSQL1 and mSQL2,
    they former will be DBD::mSQL1.

    Other questions are the directories with header files and libraries. For
    example, of your file mysql.h is in /usr/include/mysql/mysql.h, then
    enter the header directory /usr, likewise for
    /usr/lib/mysql/libmysqlclient.a or /usr/lib/libmysqlclient.so. For mSQL
    go looking for msql.h (typically in /usr/include/msql.h and libmsql.a
    (probably in /usr/lib/libmsql.a).

    See the the KNOWN PROBLEMS entry elsewhere in this document section
    below if you encounter any problems within "make" or "make test".