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 with MySQL,
install the following:
DBD::mysqlmodule. This is the DataBase Driver (DBD) module for Perl.
Optionally, the DBD module for any other type of database server you want to access.
Perl DBI is the recommended Perl interface. It replaces an older
mysqlperl, which should be
These sections contain information about using Perl with MySQL and writing MySQL applications in Perl:
For installation instructions for Perl DBI support, see Section 2.13, “Perl Installation Notes”.
For an example of reading options from option files, see Section 5.6.4, “Using Client Programs in a Multiple-Server Environment”.
For secure coding tips, see Section 6.1.1, “Security Guidelines”.
For debugging tips, see Section 220.127.116.11, “Debugging mysqld under gdb”.
For some Perl-specific environment variables, see Section 2.12, “Environment Variables”.
For considerations for running on OS X, see Section 2.4, “Installing MySQL on OS X”.
For ways to quote string literals, see Section 9.1.1, “String Literals”.
DBI information is available at the command line, online, or in printed form:
Once you have the
DBD::mysqlmodules installed, you can get information about them at the command line with the
You can also use
pod2html, and so on to translate this information into other formats.
For online information about Perl DBI, visit the DBI Web site, http://dbi.perl.org/. That site hosts a general DBI mailing list. Oracle Corporation hosts a list specifically about
DBD::mysql; see Section 1.5.1, “MySQL Mailing Lists”.
For printed information, the official DBI book is Programming the Perl DBI (Alligator Descartes and Tim Bunce, O'Reilly & Associates, 2000). Information about the book is available at the DBI Web site, http://dbi.perl.org/.
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/.