Book HomeMySQL and mSQLSearch this book

Chapter 21. Perl Reference

Contents:

Installation
DBI.pm API
Msql.pm API
Mysql.pm API

21.1. Installation

To use the mSQL and MySQL interfaces to DataBase Dependent/DataBase Independent (DBI/DBD) or to the MsqlPerl and MysqlPerl modules, you must have the following:

Perl 5

You must have a working copy of Perl 5 on your system. At the time of this writing, the newest release of Perl was 5.005_02. You should have at least Perl 5.004 since earlier versions of Perl contained security related bugs. For more information about Perl, including download sites, see http://www.perl.com.

DBI

The DataBase Independent portion of the DBI/DBD module can be downloaded from the Comprehensive Perl Archive Network (CPAN). At the time of this writing, the most recent version is DBI-0.90. You can find it at http://www.perl.com/CPAN/modules/by-authors/id/Tim_Bunce/.

Data::ShowTable

Data::ShowTable is a module that simplifies the act of displaying large amounts of data. The Msql-Mysql modules require this. The most recent version is Data-ShowTable-3.3 and it can be found at http://www.perl.com/CPAN/authors/id/AKSTE/Data-ShowTable-3.3.tar.gz.

mSQL and/or MySQL

Chapter 3, "Installation", contains information about how to obtain and install the mSQL and MySQL database servers.

C compiler and related tools

The MsqlPerl and MysqlPerl modules require an ANSI compliant C compiler as well some common related tools (such as make, ld, etc.). The tools that built the copy of Perl you are using should be sufficient. If you have no such tools, the GNU C compiler (along with all necessary supporting programs) is available free at ftp://ftp.gnu.org/pub/gnu/.

The current maintainer of the Msql-Mysql modules is Jochen Wiedmann, who has the CPAN author ID of JWIED. Therefore, the current release of the Msql-Mysql modules can always be found at http://www.perl.com/authors/id/JWIED. At the time of this writing, the current version is Msql-Mysql-modules-1.2017.tar.gz.

After you have downloaded the package, uncompress and untar it into a directory.

tar xvzf Msql-Mysql-modules-1.2017.tar.gz
cd Msql-Mysql-modules-1.2017

Inside the distribution directory is the file INSTALL, which gives several installation hints. The first step is to execute the Makefile.PL file:

perl Makefile.PL

This command starts by asking whether you want to install the modules for mSQL, MySQL or both. You can install the modules for whichever database server that you have installed.

After some system checking, the program then asks for the location of your mSQL installation. This is the directory that contains the lib and include subdirectories that have the mSQL library and include files. By default it is /usr/local/Hughes, but be sure to double check this, as many systems use /usr/local or even /usr/local/Minerva.

Next the installation script asks for the location of MySQL. As with mSQL, this is the directory that contains the appropriate lib and include subdirectories. By default it is /usr/local. This is the correct location for most installations, but you should double check in case it is located elsewhere.

At this point, the installation script creates the appropriate makefiles and exits. The next step is to run make to compile the files.

make

If your Perl, mSQL, and/or MySQL are all installed correctly, the make should run without errors. When it is finished, all of the modules have been created and all that is left is to test and install them.

make test

While this is running, a series of test names will scroll down your screen. All of them should end with . . . ok. Finally, you need to install the modules.

make install

You need to have permission to write to the Perl installation directory to install the modules. In addition, you need to have permission to write to your system binary directory (usually /usr/local/bin or /usr/bin) to install the supporting programs that come with the module (pmsql, pmysql, and dbimon).



Library Navigation Links

Copyright © 2001 O'Reilly & Associates. All rights reserved.