Rechercher dans le manuel MySQL
28.9 MySQL Perl API
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 with MySQL,
install the following:
The
DBI
module.The
DBD::mysql
module. 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
interface called mysqlperl
, which should be
considered obsolete.
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.8.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 29.5.1.4, “Debugging mysqld under gdb”.
For some Perl-specific environment variables, see Section 4.9, “MySQL Environment Variables”.
For considerations for running on OS X, see Section 2.4, “Installing MySQL on macOS”.
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
DBI
andDBD::mysql
modules installed, you can get information about them at the command line with theperldoc
command:shell> perldoc DBI shell> perldoc DBI::FAQ shell> perldoc DBD::mysql
You can also use
pod2man
,pod2html
, and so on to translate this information into other formats.For online information about Perl DBI, visit the DBI website, http://dbi.perl.org/. That site hosts a general DBI mailing list.
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 website, http://dbi.perl.org/.
Document created the 26/06/2006, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/mysql-rf-apis-perl.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.