Team LiB
Previous Section Next Section

Obtaining MySQL and Related Software

To use this book, you must install MySQL if you haven't already done so, but you need install only those third-party tools that you plan to use:

  • To write Perl scripts that access MySQL databases, you must install the DBI and DBD::mysql modules. If you plan to write Web-based DBI scripts, you'll probably want to install the CGI.pm module as well, and you'll need a Web server. The Apache server is used in this book, but others may work, too.

  • If you want to write PHP scripts as described in this book, you must install PHP and also the DB module from PEAR (the PHP Extension and Add-on Repository). Normally, PHP is used for Web scripting, which means you also need a Web server. As for Perl, the Apache server is used in this book for PHP scripts.

Precompiled binaries are available for many of the installation packages. For example, RPM files are available for Linux. If you prefer to compile software from source, or if a binary distribution isn't available for your platform, you'll need a C compiler (C++ for MySQL).

If you have an account with an Internet service provider that offers MySQL services, then it's very likely that all these packages have been installed already. In that case, you can go ahead and use them and skip the rest of this appendix. Otherwise, the primary distribution points for each of the packages you'll need are shown in the following table. Several of these sites offer mirror sites that provide the same software but that may be closer to you and result in better download times.

Package

Location

MySQL

http://dev.mysql.com/

Perl modules

http://cpan.perl.org/

PHP

http://www.php.net/

PEAR

http://pear.php.net/

Apache

http://httpd.apache.org/


The version and distribution format of a package that you install depends on your needs:

  • If you need maximum stability, you probably should be conservative and use the most recent stable version of a package. That gives you the benefit of the newest features and the greatest number of bug fixes without exposing you to experimental code in development versions.

  • If you're interested in being on the cutting edge, or you require a feature that's available only in the newest version, you should use the latest development release.

  • For MySQL, pre-built binary distributions often are built using optimization flags that are better than what the configuration script in the source distribution might figure out by itself. The MySQL developers recommend that you use a binary distribution of MySQL obtained from dev.mysql.com if possible. They build distributions using some commercial optimizing compilers to make MySQL even faster. Consequently, programs in a binary distribution may run faster than those you'd compile yourself. In addition, the developers have extensive experience in avoiding or working around compiler and system library bugs that result in incorrect code that prevents MySQL from working properly.

The Web sites for each package indicate which versions are the latest stable releases and which are development releases. They also provide per-version feature change lists to help you decide which release is best for you.

Some binary distributions are available in the native packaging format for a given platform, such as RPM files for Linux or DMG packages for Mac OS X. Other more generic formats also are available, such as compressed tar files for various Unix systems and Zip archives for Windows.

If you are working with a binary distribution, unpacking it is equivalent to installing it because the files are unpacked into the directories where you want them to end up. On Unix, you might need to be root to unpack a distribution if it installs files in protected directories.

Source distributions generally take the form of compressed tar files. You can unpack a source distribution into the area that you want to use for compiling, and then install the software into the desired installation location. On Unix, you might need to be root to perform the install step, but that should not be necessary for any configuration or compilation steps.

If you are installing from source on Unix, several of the packages discussed here are configured with the configure utility, which makes it easy to set up and build software on a variety of systems. If a build fails, you might need to rerun configure with different options than those you originally specified. Before doing so, you should prevent configure from picking up information that it saved from the previous time you ran it. Clean out the stored configuration like this:

% make distclean

Or like this:

% rm config.cache
% make clean

Subscribing to Mailing Lists for Help

When you install a package, it's a good idea to subscribe to the general discussion list for that package so that you can ask questions and receive helpful answers. If you install development releases, you definitely should join and read the mailing list associated with the software to stay abreast of bug reports and fixes. If you don't join a general discussion list, you should at least subscribe to the announcement list so that you receive notices of new releases. Instructions for subscribing to mailing lists and using them are provided in the Introduction. The Web sites for each package also provide subscription information.


    Team LiB
    Previous Section Next Section