home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Book HomeManaging and Using MySQLSearch this book

Chapter 2. Installation

This chapter describes how to download and install MySQL. MySQL is available for a wide variety of target operating systems. In this chapter, we provide an overview of how to install MySQL in binary and source formats for Solaris and Linux as well as binary installation for Windows 9x/NT/2000/XP. Though we specifically address only Solaris, Linux, and Win32, the Solaris/Linux instructions apply to most Unix-based operating systems, including Mac OS X, FreeBSD, and AIX.

2.1. Preparation

Before you begin installing MySQL, you must answer the following questions:

  1. Which version will you install?

    This is typically a decision between the latest stable release and the latest development release. In general, we recommended that you go with the latest stable release, unless you need specific features in a development release that are not available in the stable release.

    The current stable versions are MySQL 3.23 and MySQL-Max 3.23. MySQL-Max is a beta release of the MySQL software with support for transactions (via BerkeleyDB and InnoDB tables). The standard MySQL binary does not include support for these types of tables.

    The current development versions are MySQL 4.0 and MySQL-Max 4.0. The installation instructions provided here will work with either Version 3.23 or 4.0.

  2. Are you going to install MySQL as root or as another user?

    MySQL does not require root access to run, but installing it as root will enable you to make one copy available to everyone on your system. If you do not have root access, you must install it in your home directory. However, even if you install MySQL as root, it is a good idea to run it as a different user. In this way, all data in the database can be protected from all other users by setting the permissions on the datafiles to be readable by only the special MySQL user. In addition, if the security of the database becomes compromised, the attacker has access only to the special MySQL user account, which has no privileges beyond the database.

  3. Do you want to install a source or binary distribution?

    In general, we recommend that you install a binary distribution if one is available for your platform. In most cases, a binary distribution is easier to install than a source distribution and provides the fastest and most reliable way to get MySQL up and running. The MySQL team and contributors have gone to great lengths to ensure that the binary distributions on their site are built with the best possible options. However, you may encounter cases in which you need to build your MySQL distribution from scratch. For example, here are a few reasons why you would need to install a source distribution:

    • You are unable to locate a binary distribution for your target system.

    • You want to configure MySQL with some combination of options that is not available in any of the binary distributions.

    • You want to compile in support for additional character sets.

    • You want to optimize your MySQL installation by modifying compiler options or by using a different compiler.

    • You need to apply a bug fix patch.

Having decided on a version and whether to use a binary or source distribution, you can complete the first step in installing MySQL: downloading it. The best place to obtain MySQL source or binary distributions is from the MySQL downloads page, at http://www.mysql.com/downloads. You can alternately find MySQL on one of the many mirror sites, at http://www.mysql.com/downloads/mirrors.html.



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.