Chapter 2 Installing and Upgrading MySQL

Table of Contents

2.1 General Installation Guidance
2.1.1 Choosing Which MySQL Distribution to Install
2.1.2 How to Get MySQL
2.1.3 Verifying Package Integrity Using MD5 Checksums or GnuPG
2.1.4 Installation Layouts
2.1.5 Compiler-Specific Build Characteristics
2.2 Installing MySQL on Unix/Linux Using Generic Binaries
2.3 Installing MySQL on Microsoft Windows
2.3.1 MySQL Installation Layout on Microsoft Windows
2.3.2 Choosing the Installation Package for Microsoft Windows
2.3.3 MySQL Notifier
2.3.4 Installing MySQL on Microsoft Windows Using an MSI Package
2.3.5 Using the MySQL Server Instance Config Wizard
2.3.6 Installing MySQL on Microsoft Windows Using a noinstall Zip Archive
2.3.7 Troubleshooting a Microsoft Windows MySQL Server Installation
2.3.8 Windows Postinstallation Procedures
2.3.9 Upgrading MySQL Server on Microsoft Windows
2.4 Installing MySQL on OS X
2.4.1 General Notes on Installing MySQL on OS X
2.4.2 Installing MySQL on OS X Using Native Packages
2.4.3 Installing a MySQL Launch Daemon
2.4.4 Installing the MySQL Startup Item
2.4.5 Installing and Using the MySQL Preference Pane
2.4.6 Using the Bundled MySQL on OS X Server
2.5 Installing MySQL on Linux
2.5.1 Installing MySQL on Linux Using RPM Packages
2.5.2 Installing MySQL on Linux Using Native Package Managers
2.6 Installing MySQL on Solaris and OpenSolaris
2.6.1 Installing MySQL on Solaris Using a Solaris PKG
2.6.2 Installing MySQL on OpenSolaris Using IPS
2.7 Installing MySQL on IBM AIX
2.7.1 General Notes on Installing MySQL on AIX
2.8 Installing MySQL on HP-UX
2.8.1 General Notes on Installing MySQL on HP-UX
2.8.2 Installing MySQL on HP-UX Using DEPOT Packages
2.9 Installing MySQL on FreeBSD
2.10 Installing MySQL on i5/OS
2.11 Installing MySQL from Source
2.11.1 MySQL Layout for Source Installation
2.11.2 Installing MySQL Using a Standard Source Distribution
2.11.3 Installing MySQL Using a Development Source Tree
2.11.4 MySQL Source-Configuration Options
2.11.5 Dealing with Problems Compiling MySQL
2.11.6 Compiling and Linking an Optimized mysqld Server
2.11.7 Installing MySQL from Source on Windows
2.11.8 Notes on Installing MySQL on Solaris from Source
2.11.9 Notes on Installing MySQL on AIX from Source
2.11.10 Notes on Installing MySQL on HP-UX from Source
2.12 Postinstallation Setup and Testing
2.12.1 Initializing the Data Directory
2.12.2 Starting the Server
2.12.3 Testing the Server
2.12.4 Securing the Initial MySQL Accounts
2.12.5 Starting and Stopping MySQL Automatically
2.13 Upgrading or Downgrading MySQL
2.13.1 Upgrading MySQL
2.13.2 Downgrading MySQL
2.13.3 Checking Whether Tables or Indexes Must Be Rebuilt
2.13.4 Rebuilding or Repairing Tables or Indexes
2.13.5 Copying MySQL Databases to Another Machine
2.14 Environment Variables
2.15 Perl Installation Notes
2.15.1 Installing Perl on Unix
2.15.2 Installing ActiveState Perl on Windows
2.15.3 Problems Using the Perl DBI/DBD Interface

End of Product Lifecycle. Active development for MySQL Database Server version 5.1 has ended. Oracle offers various support offerings which may be of interest. For details and more information, see the MySQL section of the Lifetime Support Policy for Oracle Technology Products ( Please consider upgrading to a recent version.

This chapter describes how to obtain and install MySQL. A summary of the procedure follows and later sections provide the details. If you plan to upgrade an existing version of MySQL to a newer version rather than install MySQL for the first time, see Section 2.13.1, “Upgrading MySQL”, for information about upgrade procedures and about issues that you should consider before upgrading.

If you are interested in migrating to MySQL from another database system, see Section A.8, “MySQL 5.1 FAQ: Migration”, which contains answers to some common questions concerning migration issues.

If you are migrating from MySQL Enterprise Edition to MySQL Community Server, see Section, “Downgrading from MySQL Enterprise Edition to MySQL Community Server”.

Installation of MySQL generally follows the steps outlined here:

  1. Determine whether MySQL runs and is supported on your platform.

    Please note that not all platforms are equally suitable for running MySQL, and that not all platforms on which MySQL is known to run are officially supported by Oracle Corporation.

  2. Choose which distribution to install.

    Several versions of MySQL are available, and most are available in several distribution formats. You can choose from pre-packaged distributions containing binary (precompiled) programs or source code. When in doubt, use a binary distribution. Oracle also provides access to the MySQL source code for those who want to see recent developments and test new code. To determine which version and type of distribution you should use, see Section 2.1.1, “Choosing Which MySQL Distribution to Install”.

  3. Download the distribution that you want to install.

    For instructions, see Section 2.1.2, “How to Get MySQL”. To verify the integrity of the distribution, use the instructions in Section 2.1.3, “Verifying Package Integrity Using MD5 Checksums or GnuPG”.

  4. Install the distribution.

    To install MySQL from a binary distribution, use the instructions in Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”.

    To install MySQL from a source distribution or from the current development source tree, use the instructions in Section 2.11, “Installing MySQL from Source”.

  5. Perform any necessary postinstallation setup.

    After installing MySQL, see Section 2.12, “Postinstallation Setup and Testing” for information about making sure the MySQL server is working properly. Also refer to the information provided in Section 2.12.4, “Securing the Initial MySQL Accounts”. This section describes how to secure the initial MySQL user accounts, which have no passwords until you assign passwords. The section applies whether you install MySQL using a binary or source distribution.

  6. If you want to run the MySQL benchmark scripts, Perl support for MySQL must be available. See Section 2.15, “Perl Installation Notes”.

Instructions for installing MySQL on different platforms and environments is available on a platform by platform basis: