Two steps to connect perl to the MySQL database

Source: Internet
Author: User
Tags learn perl

The following describes how to use perl to connect to the MySQL database, including how to correctly install the module.,The following is a description of the MySQL database module on CPAN. I hope you will have a deeper impression on it after reading it.

I used activeperl to learn perl in windows. Today I want to use perl to connect to the MySQL database.

1. Installation Module

First, input ppm in dos. A graphical interface will pop up to list all modules. I want to find the module name that contains MySQL, but I cannot find it. I only see dbi and install it, an error is reported when the test program is running:

 
 
  1. install_driver(MySQL) failed: Can't locate DBD/MySQL.pm in @INC (@INC contains:  
  2. C:/Perl/site/lib C:/Perl/lib .) at (eval 5) line 3.  
  3. Perhaps the DBD::MySQL perl module hasn't been fully installed,  
  4. or perhaps the capitalisation of 'MySQL' isn't right.  
  5. Available drivers: CSV, DBM, ExampleP, File, Gofer, ODBC, Oracle, Proxy, SQLite,  
  6. Sponge.  
  7. at test.pl line 4  

2 Google a moment, found the following web page, http://forums.sixapart.com/lofiversion/index.php/t29943.html

If you see an In addition to DBI, you also need DBD: MySQL, enter ppm install "DBD: MySQL" under dos. The installation starts and starts successfully. Run the test program.

To put it bluntly, NND: I think how should I add a MySQL character to the module name, but it is not listed in the graphic interface, causing me to spend a few hours.

In addition, the address of the MySQL module on CPAN:

Http://search.cpan.org /~ Capttofu/DBD-MySQL-4.013/lib/DBD/MySQL. pm

PS: cnblog website classification-> There are python in programming languages, and there is no perl.

The above content is an introduction to perl's connection to the MySQL database. I hope you will find some gains.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.