[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The Perl DBI
module provides a generic interface for database access.
You can write a DBI script that works with many different database engines
without change. To use DBI, you must install the DBI
module, as well
as a DataBase Driver (DBD) module for each type of server you want to access.
For MySQL, this driver is the DBD::mysql
module.
Perl DBI is now the recommended Perl interface. It replaces an older
interface called mysqlperl
, which should be considered obsolete.
Installation instructions for Perl DBI support are given in 2.7 Perl Installation Notes.
DBI information is available at the command line, online, or in printed form:
DBI
and DBD::mysql
modules installed, you can
get information about them at the command line with the perldoc
command:
shell> perldoc DBI shell> perldoc DBI::FAQ shell> perldoc DBD::mysql |
You can also use pod2man
, pod2html
, and so forth to translate
this information into other formats.
For information that focuses specifically on using DBI with MySQL, see MySQL and Perl for the Web (Paul DuBois, New Riders, 2001). This book's web site is http://www.kitebird.com/mysql-perl/.