Apache - Perl - MySQL

Apache - Perl - MySQL
The Big Picture

Installing and Setting Up MySQL

Installing MySQL Perl DBI:DBD Modules

Testing Apache - Perl - MySQL

Mac OS X users are immediately provided with two powerful tools to host commerical quality web sites. Specifically:

  • The Apache web server for delivering HTML pages
  • The Perl environment for delivering dynamic content

What is currently missing in this combination is a relational database engine.

MySQL is an extremely powerful and Open Source SQL based database package. When combined with Perl and the Apache web server, it can readily provide the relational database engine to drive powerful web applications.

The above diagram illustrates how these components interact. The default Mac OS X installation includes the Apache Web Server and Perl. This tutorial describes how to install and setup MySQL and the Perl DBI::DBD modules to run under Mac OS X. There are a few pecularities of Mac OS X which require some additional installation steps. This tutorial assumes you are running Mac OS X 10.2 (Jaguar) or later.

Before proceeding, it is important to note that there is more than one way to install and configure MySQL and the DBI, DBD::mysql modules. In our case we describe installing MySQL from widely available Mac OS X precompiled binaries, and installing the DBI, DBD Perl modules from the CPAN module packages. There are other excellent references which describe installations in a bit different manner and which typically produce similar configurations. Specifically:

  • Marc Liyanage has an excellent description of installing MySQL (and other Mac OS X packages)
  • Apple has an excellent description of installing MySQL (and brief description of PostgreSQL)
  • CGI::AppToolkit offers users a binary installer for the Perl DBI and DBD ::mysql modules

So why yet another site describing how to do this? Here is why. We want to:

  • Provide directions on how to use the latest available open source software.
  • Offer a single site describing how to install both the MySQL database engine and the Perl DBI, DBD::mysql modules.
  • Describe how to do almost all of the installation and configuration using only a Mac OS X Terminal window.
  • Offer a convenient (and FREE!) MySQL Monitor tool which works through a browser.

and if all else fails,

  • Give you the option to have us do the installation and configuration for you!

We hope we have met these goals. Please drop me a note at "macosx_mysql@quicomm.com" to let us know how we've done.

--- Brad Bennett