8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 95%

31.9 MySQL Perl API

Perl DBI 模块提供了一个通用的数据库访问接口。你可以编写一个 DBI 脚本,使其可以在不更改的情况下与许多不同的数据库引擎一起使用。要将 DBI 与 MySQL 一起使用,请安装以下内容: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:

  1. DBI 模块。The DBI module.

  2. DBD::mysql 模块。 这是 Perl 的数据库驱动程序 (DBD) 模块。The DBD::mysql module. This is the DataBase Driver (DBD) module for Perl.

  3. 可选地,你可以使用适用于任何其他类型数据库服务器的 DBD 模块。Optionally, the DBD module for any other type of database server you want to access.

Perl DBI 是推荐的 Perl 接口。它取代了一个较旧的接口 mysqlperl,该接口应被视为过时。Perl DBI is the recommended Perl interface. It replaces an older interface called mysqlperl, which should be considered obsolete.

这些部分包含有关在 Perl 中使用 MySQL 以及使用 Perl 编写 MySQL 应用程序的信息:These sections contain information about using Perl with MySQL and writing MySQL applications in Perl:

DBI 信息可通过命令行、在线或纸质形式获取:DBI information is available at the command line, online, or in printed form:

  • 一旦你安装了 DBI 和 DBD::mysql 模块,你可以使用 perldoc 命令在命令行中获取它们的信息:Once you have the DBI and DBD::mysql modules installed, you can get information about them at the command line with the perldoc command:

    $> perldoc DBI
    $> perldoc DBI::FAQ
    $> perldoc DBD::mysql
    

    你也可以使用 pod2man、pod2html 等将这些信息转换成其他格式。You can also use pod2man, pod2html, and so on to translate this information into other formats.

  • 有关 Perl DBI 的在线信息,请访问 DBI 网站,http://dbi.perl.org/。该网站主持一个通用的 DBI 邮件列表。For online information about Perl DBI, visit the DBI website, http://dbi.perl.org/. That site hosts a general DBI mailing list.

  • 有关印刷信息,官方 DBI 书籍是 Programming the Perl DBI(Alligator Descartes 和 Tim Bunce 著,O'Reilly & Associates,2000 年)。有关该书的信息可在 DBI 网站获取,http://dbi.perl.org/。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/.