Chapter 2. Installing and Upgrading MySQL

MySQL 5.0

Chapter 2. Installing and Upgrading MySQL

Table of Contents

2.1. General Installation Issues
2.1.1. Operating Systems Supported by MySQL
2.1.2. Choosing Which MySQL Distribution to Install
2.1.3. How to Get MySQL
2.1.4. Verifying Package Integrity Using MD5 Checksums or
2.1.5. Installation Layouts
2.2. Standard MySQL Installation Using a Binary Distribution
2.3. Installing MySQL on Windows
2.3.1. Choosing An Installation Package
2.3.2. Installing MySQL with the Automated Installer
2.3.3. Using the MySQL Installation Wizard
2.3.4. Using the Configuration Wizard
2.3.5. Installing MySQL from a Noinstall Zip Archive
2.3.6. Extracting the Install Archive
2.3.7. Creating an Option File
2.3.8. Selecting a MySQL Server type
2.3.9. Starting the Server for the First Time
2.3.10. Starting MySQL from the Windows Command Line
2.3.11. Starting MySQL as a Windows Service
2.3.12. Testing The MySQL Installation
2.3.13. Troubleshooting a MySQL Installation Under Windows
2.3.14. Upgrading MySQL on Windows
2.3.15. MySQL on Windows Compared to MySQL on Unix
2.4. Installing MySQL on Linux
2.5. Installing MySQL on Mac OS X
2.6. Installing MySQL on Solaris
2.7. Installing MySQL on NetWare
2.8. Installing MySQL on Other Unix-Like Systems
2.9. MySQL Installation Using a Source Distribution
2.9.1. Source Installation Overview
2.9.2. Typical configure Options
2.9.3. Installing from the Development Source Tree
2.9.4. Dealing with Problems Compiling MySQL
2.9.5. MIT-pthreads Notes
2.9.6. Installing MySQL from Source on Windows
2.9.7. Compiling MySQL Clients on Windows
2.10. Post-Installation Setup and Testing
2.10.1. Windows Post-Installation Procedures
2.10.2. Unix Post-Installation Procedures
2.10.3. Securing the Initial MySQL Accounts
2.11. Upgrading MySQL
2.11.1. Upgrading from MySQL 5.0 to 5.1
2.11.2. Upgrading from MySQL 4.1 to 5.0
2.11.3. Copying MySQL Databases to Another Machine
2.12. Downgrading MySQL
2.12.1. Downgrading to MySQL 4.1
2.13. Operating System-Specific Notes
2.13.1. Linux Notes
2.13.2. Mac OS X Notes
2.13.3. Solaris Notes
2.13.4. BSD Notes
2.13.5. Other Unix Notes
2.13.6. OS/2 Notes
2.14. Perl Installation Notes
2.14.1. Installing Perl on Unix
2.14.2. Installing ActiveState Perl on Windows
2.14.3. Problems Using the Perl / Interface

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.11, “Upgrading MySQL”, for information about upgrade procedures and about issues that you should consider before upgrading.

  1. Determine whether your platform is supported. Please note that not all supported systems are equally suitable for running MySQL. On some platforms it is much more robust and efficient than others. See Section 2.1.1, “Operating Systems Supported by MySQL”, for details.

  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. We also provide public access to our current source tree for those who want to see our most recent developments and help us test new code. To determine which version and type of distribution you should use, see Section 2.1.2, “Choosing Which MySQL Distribution to Install”.

  3. Download the distribution that you want to install. For instructions, see Section 2.1.3, “How to Get MySQL”. To verify the integrity of the distribution, use the instructions in Section 2.1.4, “Verifying Package Integrity Using MD5 Checksums or .

  4. Install the distribution. To install MySQL from a binary distribution, use the instructions in Section 2.2, “Standard MySQL Installation Using a Binary Distribution”. To install MySQL from a source distribution or from the current development source tree, use the instructions in Section 2.9, “MySQL Installation Using a Source Distribution”.

    If you encounter installation difficulties, see Section 2.13, “Operating System-Specific Notes”, for information on solving problems for particular platforms.

  5. Perform any necessary post-installation setup. After installing MySQL, read Section 2.10, “Post-Installation Setup and Testing”. This section contains important information about making sure the MySQL server is working properly. It also 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.14, “Perl Installation Notes”.

2.1. General Installation Issues

Before installing MySQL, you should do the following:

  1. Determine whether MySQL runs on your platform.

  2. Choose a distribution to install.

  3. Download the distribution and verify its integrity.

This section contains the information necessary to carry out these steps. After doing so, you can use the instructions in later sections of the chapter to install the distribution that you choose.

2.1.1. Operating Systems Supported by MySQL

This section lists the operating systems on which you can expect to be able to run MySQL.

We use GNU Autoconf, so it is possible to port MySQL to all modern systems that have a C++ compiler and a working implementation of POSIX threads. (Thread support is needed for the server. To compile only the client code, the only requirement is a C++ compiler.) We use and develop the software ourselves primarily on Linux (SuSE and Red Hat), FreeBSD, and Sun Solaris (versions 8 and 9).

MySQL has been reported to compile successfully on the following combinations of operating system and thread package. Note that for many operating systems, native thread support works only in the latest versions.

Not all platforms are equally well-suited for running MySQL. How well a certain platform is suited for a high-load mission-critical MySQL server is determined by the following factors:

  • General stability of the thread library. A platform may have an excellent reputation otherwise, but MySQL is only as stable as the thread library it calls, even if everything else is perfect.

  • The capability of the kernel and the thread library to take advantage of symmetric multi-processor (SMP) systems. In other words, when a process creates a thread, it should be possible for that thread to run on a CPU different from the original process.

  • The capability of the kernel and the thread library to run many threads that acquire and release a mutex over a short critical region frequently without excessive context switches. If the implementation of is too anxious to yield CPU time, this hurts MySQL tremendously. If this issue is not taken care of, adding extra CPUs actually makes MySQL slower.

  • General filesystem stability and performance.

  • If your tables are large, performance is affected by the ability of the filesystem to deal with large files at all and to deal with them efficiently.

  • Our level of expertise here at MySQL AB with the platform. If we know a platform well, we enable platform-specific optimizations and fixes at compile time. We can also provide advice on configuring your system optimally for MySQL.

  • The amount of testing we have done internally for similar configurations.

  • The number of users that have run MySQL successfully on the platform in similar configurations. If this number is high, the likelihood of encountering platform-specific surprises is much smaller.

Based on the preceding criteria, the best platforms for running MySQL at this point are x86 with SuSE Linux using a 2.4 or 2.6 kernel, and ReiserFS (or any similar Linux distribution) and SPARC with Solaris (2.7-9). FreeBSD comes third, but we really hope it joins the top club once the thread library is improved. We also hope that at some point we are able to include into the top category all other platforms on which MySQL currently compiles and runs, but not quite with the same level of stability and performance. This requires some effort on our part in cooperation with the developers of the operating systems and library components that MySQL depends on. If you are interested in improving one of those components, are in a position to influence its development, and need more detailed instructions on what MySQL needs to run better, send an email message to the MySQL mailing list. See Section 1.7.1, “MySQL Mailing Lists”.

Please note that the purpose of the preceding comparison is not to say that one operating system is better or worse than another in general. We are talking only about choosing an OS for the specific purpose of running MySQL. With this in mind, the result of this comparison might be different if other factors were considered. In some cases, the reason one OS is better for MySQL than another might simply be that we have been able to put more effort into testing and optimizing for a particular platform. We are just stating our observations to help you decide which platform to use for running MySQL.

2.1.2. Choosing Which MySQL Distribution to Install

When preparing to install MySQL, you should decide which version to use. MySQL development occurs in several release series, and you can pick the one that best fits your needs. After deciding which version to install, you can choose a distribution format. Releases are available in binary or source format.

2.1.2.1. Choosing Which Version of MySQL to Install

The first decision to make is whether you want to use a production (stable) release or a development release. In the MySQL development process, multiple release series co-exist, each at a different stage of maturity:

  • MySQL 5.1 is the current development release series.

  • MySQL 5.0 is the current stable (production-quality) release series. New releases are issued for bugfixes only; no new features are being added that could effect stability.

  • MySQL 4.1 is the previous stable (production-quality) release series. New releases are issued for critical bugfixes and security fixes. No significant new features are to be added to this series.

  • MySQL 4.0 and 3.23 are the old stable (production-quality) release series. These versions are now retired, so new releases are issued only to fix extremely critical bugs (primarily security issues).

We do not believe in a complete code freeze because this prevents us from making bugfixes and other fixes that must be done. By “somewhat frozen” we mean that we may add small things that should not affect anything that currently works in a production release. Naturally, relevant bugfixes from an earlier series propagate to later series.

Normally, if you are beginning to use MySQL for the first time or trying to port it to some system for which there is no binary distribution, we recommend going with the production release series. Currently, this is MySQL 5.0. All MySQL releases, even those from development series, are checked with the MySQL benchmarks and an extensive test suite before being issued.

If you are running an older system and want to upgrade, but do not want to take the chance of having a non-seamless upgrade, you should upgrade to the latest version in the same release series you are using (where only the last part of the version number is newer than yours). We have tried to fix only fatal bugs and make only small, relatively “safe” changes to that version.

If you want to use new features not present in the production release series, you can use a version from a development series. Note that development releases are not as stable as production releases.

If you want to use the very latest sources containing all current patches and bugfixes, you can use one of our BitKeeper repositories. These are not “releases” as such, but are available as previews of the code on which future releases are to be based.

The MySQL naming scheme uses release names that consist of three numbers and a suffix; for example, mysql-5.0.12-beta. The numbers within the release name are interpreted as follows:

  • The first number (5) is the major version and describes the file format. All MySQL 5 releases have the same file format.

  • The second number (0) is the release level. Taken together, the major version and release level constitute the release series number.

  • The third number (12) is the version number within the release series. This is incremented for each new release. Usually you want the latest version for the series you have chosen.

For each minor update, the last number in the version string is incremented. When there are major new features or minor incompatibilities with previous versions, the second number in the version string is incremented. When the file format changes, the first number is increased.

Release names also include a suffix to indicates the stability level of the release. Releases within a series progress through a set of suffixes to indicate how the stability level improves. The possible suffixes are:

  • alpha indicates that the release contains new features that have not been thoroughly tested. Known bugs should be documented in the News section. See Appendix D, MySQL Change History. Most alpha releases implement new commands and extensions. Active development that may involve major code changes can occur in an alpha release. However, we do conduct testing before issuing a release.

  • beta means that the release is intended to be feature-complete and that all new code has been tested. No major new features that are added. There should be no known critical bugs. A version changes from alpha to beta when there have been no reported fatal bugs within an alpha version for at least a month and we have no plans to add any new features that could make previously implemented features unreliable.

    All APIs, externally visible structures, and columns for SQL statements will not change during future beta, release candidate, or production releases.

  • rc is a release candidate; that is, a beta that has been around for a while and seems to work well. Only minor fixes are added. (A release candidate is what formerly was known as a gamma release.)

  • If there is no suffix, it means that the version has been run for a while at many different sites with no reports of critical repeatable bugs other than platform-specific bugs. Only critical bugfixes are applied to the release. This is what we call a production (stable) or “General Availability” (GA) release.

MySQL uses a naming scheme that is slightly different from most other products. In general, it is usually safe to use any version that has been out for a couple of weeks without being replaced by a new version within the same release series.

All releases of MySQL are run through our standard tests and benchmarks to ensure that they are relatively safe to use. Because the standard tests are extended over time to check for all previously found bugs, the test suite keeps getting better.

All releases have been tested at least with these tools:

We also test the newest MySQL version in our internal production environment, on at least one machine. We have more than 100GB of data to work with.

2.1.2.2. Choosing a Distribution Format

After choosing which version of MySQL to install, you should decide whether to use a binary distribution or a source distribution. In most cases, you should probably use a binary distribution, if one exists for your platform. Binary distributions are available in native format for many platforms, such as RPM files for Linux or PKG package installers for Mac OS X or Solaris. Distributions also are available as Zip archives or compressed tar files.

Reasons to choose a binary distribution include the following:

  • Binary distributions generally are easier to install than source distributions.

  • To satisfy different user requirements, we provide two different binary versions. One is compiled with the core feature set. The other (MySQL-Max) is compiled with an extended feature set. Both versions are compiled from the same source distribution. All native MySQL clients can connect to servers from either MySQL version.

    The extended MySQL binary distribution is identified by the suffix and is configured with the same options as mysqld-max. See Section 5.3, “The mysqld-max Extended MySQL Server”.

    For RPM distributions, if you want to use the RPM, you must first install the standard RPM.

Under some circumstances, you may be better off installing MySQL from a source distribution:

  • You want to install MySQL at some explicit location. The standard binary distributions are ready to run at any installation location, but you might require even more flexibility to place MySQL components where you want.

  • You want to configure mysqld to ensure that features are available that might not be included in the standard binary distributions. Here is a list of the most common extra options that you may want to use to ensure feature availability:

    • (not available on all platforms)

    • (this is done for some of the binaries)

  • You want to configure mysqld without some features that are included in the standard binary distributions. For example, distributions normally are compiled with support for all character sets. If you want a smaller MySQL server, you can recompile it with support for only the character sets you need.

  • You have a special compiler (such as ) or want to use compiler options that are better optimized for your processor. Binary distributions are compiled with options that should work on a variety of processors from the same processor family.

  • You want to use the latest sources from one of the BitKeeper repositories to have access to all current bugfixes. For example, if you have found a bug and reported it to the MySQL development team, the bugfix is committed to the source repository and you can access it there. The bugfix does not appear in a release until a release actually is issued.

  • You want to read (or modify) the C and C++ code that makes up MySQL. For this purpose, you should get a source distribution, because the source code is always the ultimate manual.

  • Source distributions contain more tests and examples than binary distributions.

2.1.2.3. How and When Updates Are Released

MySQL is evolving quite rapidly and we want to share new developments with other MySQL users. We try to produce a new release whenever we have new and useful features that others also seem to have a need for.

We also try to help users who request features that are easy to implement. We take note of what our licensed users want, and we especially take note of what our support customers want and try to help them in this regard.

No one is required to download a new release. The News section helps you determine whether the new release has something you really want. See Appendix D, MySQL Change History.

We use the following policy when updating MySQL:

  • Releases are issued within each series. For each release, the last number in the version is one more than the previous release within the same series.

  • Production (stable) releases are meant to appear about 1-2 times a year. However, if small bugs are found, a release with only bugfixes is issued.

  • Working releases/bugfixes to old releases are meant to appear about every 4-8 weeks.

  • Binary distributions for some platforms are made by us for major releases. Other people may make binary distributions for other systems, but probably less frequently.

  • We make fixes available as soon as we have identified and corrected small or non-critical but annoying bugs. The fixes are available immediately from our public BitKeeper repositories, and are included in the next release.

  • If by any chance a fatal bug is found in a release, our policy is to fix it in a new release as soon as possible. (We would like other companies to do this, too!)

2.1.2.4. Release Philosophy—No Known Bugs in Releases

We put considerable time and effort into making our releases bug-free. Our policy is never to release a version of MySQL intended for production use that has any known fatal, repeatable bugs.

We have documented all open problems, bugs, and issues that are dependent on design decisions. See Section A.8, “Known Issues in MySQL”.

Our aim is to fix everything that is fixable without making a stable MySQL version less stable. In certain cases, this means we can fix an issue in the development versions, but not in the stable (production) version. Naturally, we document such issues so that users are aware of them.

Here is a description of our build process:

  • We monitor bugs from our customer support list, the bugs database at http://bugs.mysql.com/, and the MySQL external mailing lists.

  • All reported bugs for live versions are entered into the bugs database.

  • When we fix a bug, we always try to make a test case for it and include it into our test system to ensure that the bug can never recur without being detected. (About 90% of all fixed bugs have test cases.)

  • We create test cases for each new feature that we add to MySQL.

  • Before we start to build a new MySQL release, we ensure that all reported repeatable bugs for that MySQL version (3.23.x, 4.0.x, 4.1.x, 5.0.x, 5.1.x, and so on) are fixed. If something is impossible to fix due to some internal design decision in MySQL, we document this in the manual. See Section A.8, “Known Issues in MySQL”.

  • We do a build on all platforms for which we support binaries and run our test suite and benchmark suite on all of them.

  • We do not publish a binary for a platform for which the test or benchmark suite fails. If the problem is due to a general error in the source, we fix it and do the build plus tests on all systems again from scratch.

  • The build and test process takes a week. If we receive a report regarding a fatal bug during this process (for example, one that causes a core dump), we fix the problem and restart the build process.

  • After publishing the binaries on http://dev.mysql.com/, we send out an announcement message to the and mailing lists. See Section 1.7.1, “MySQL Mailing Lists”. The announcement message contains a list of all changes to the release and any known problems with the release. The Known Problems section in the release notes has been needed for only a handful of releases.

  • To quickly give our users access to the latest MySQL features, we try to produce a new MySQL release every 4-8 weeks. Source code snapshots are built daily and are available at http://downloads.mysql.com/snapshots.php.

  • If, despite our best efforts, we receive any bug reports after a release is issued that a critical problem exists for the build on a specific platform, we fix it at once and build a new release for that platform. Thanks to our large user base, problems are found and resolved very quickly.

  • Our track record for making stable releases is quite good. In the last 150 releases, we had to do a new build for fewer than 10 of them. In three of these cases, the bug was a faulty library on one of our build machines that took us a long time to track down.

2.1.2.5. MySQL Binaries Compiled by MySQL AB

As a service of MySQL AB, we provide a set of binary distributions of MySQL that are compiled on systems at our site or on systems where supporters of MySQL kindly have given us access to their machines.

In addition to the binaries provided in platform-specific package formats, we offer binary distributions for a number of platforms in the form of compressed tar files ( files). See Section 2.2, “Standard MySQL Installation Using a Binary Distribution”.

The RPM distributions for MySQL 5.0 releases that we make available through our Web site are generated by MySQL AB.

For Windows distributions, see Section 2.3, “Installing MySQL on Windows”.

These distributions are generated using the script , which compiles the source code and creates the binary archive using scripts/make_binary_distribution.

These binaries are configured and built with the following compilers and options. This information can also be obtained by looking at the variables and inside the script bin/mysqlbug of every binary tar file distribution.

Anyone who has more optimal options for any of the following commands can mail them to the MySQL mailing list. See Section 1.7.1, “MySQL Mailing Lists”.

If you want to compile a debug version of MySQL, you should add or to the following configure commands and remove any options.

The following binaries are built on MySQL AB development systems:

  • Linux 2.4.xx x86 with gcc 2.95.3:

    CFLAGS="-O2 -mcpu=pentiumpro" CXX=gcc CXXFLAGS="-O2 -mcpu=pentiumpro
    -felide-constructors" ./configure --prefix=/usr/local/mysql
    --with-extra-charsets=complex --enable-thread-safe-client
    --enable-local-infile --enable-assembler --disable-shared
    --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static
    
  • Linux 2.4.x x86 with icc (Intel C++ Compiler 8.1 or later releases):

    CC=icc CXX=icpc CFLAGS="-O3 -unroll2 -ip -mp -no-gcc -restrict"
    CXXFLAGS="-O3 -unroll2 -ip -mp -no-gcc -restrict" ./configure
    --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data
    --libexecdir=/usr/local/mysql/bin --with-extra-charsets=complex
    --enable-thread-safe-client --enable-local-infile --enable-assembler
    --disable-shared --with-client-ldflags=-all-static
    --with-mysqld-ldflags=-all-static --with-embedded-server --with-innodb
    

    Note that versions 8.1 and newer of the Intel compiler have separate drivers for 'pure' C () and C++ (); if you use icc version 8.0 or older for building MySQL, you will need to set .

  • Linux 2.4.xx Intel Itanium 2 with ecc (Intel C++ Itanium Compiler 7.0):

    CC=ecc CFLAGS="-O2 -tpp2 -ip -nolib_inline" CXX=ecc CXXFLAGS="-O2
    -tpp2 -ip -nolib_inline" ./configure --prefix=/usr/local/mysql
    --with-extra-charsets=complex --enable-thread-safe-client
    --enable-local-infile
    
  • Linux 2.4.xx Intel Itanium with ecc (Intel C++ Itanium Compiler 7.0):

    CC=ecc CFLAGS=-tpp1 CXX=ecc CXXFLAGS=-tpp1 ./configure
    --prefix=/usr/local/mysql --with-extra-charsets=complex
    --enable-thread-safe-client --enable-local-infile
    
  • Linux 2.4.xx alpha with (Compaq C V6.2-505 / Compaq C++ V6.3-006):

    CC=ccc CFLAGS="-fast -arch generic" CXX=cxx CXXFLAGS="-fast -arch
    generic -noexceptions -nortti" ./configure --prefix=/usr/local/mysql
    --with-extra-charsets=complex --enable-thread-safe-client
    --enable-local-infile --with-mysqld-ldflags=-non_shared
    --with-client-ldflags=-non_shared --disable-shared
    
  • Linux 2.x.xx ppc with gcc 2.95.4:

    CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
    -fno-omit-frame-pointer -felide-constructors -fno-exceptions
    -fno-rtti" ./configure --prefix=/usr/local/mysql
    --localstatedir=/usr/local/mysql/data --libexecdir=/usr/local/mysql/bin
    --with-extra-charsets=complex --enable-thread-safe-client
    --enable-local-infile --disable-shared --with-embedded-server
    --with-innodb
    
  • Linux 2.4.xx s390 with gcc 2.95.3:

    CFLAGS="-O2" CXX=gcc CXXFLAGS="-O2 -felide-constructors" ./configure
    --prefix=/usr/local/mysql --with-extra-charsets=complex
    --enable-thread-safe-client --enable-local-infile --disable-shared
    --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static
    
  • Linux 2.4.xx x86_64 (AMD64) with gcc 3.2.1:

    CXX=gcc ./configure --prefix=/usr/local/mysql
    --with-extra-charsets=complex --enable-thread-safe-client
    --enable-local-infile --disable-shared
    
  • Sun Solaris 8 x86 with gcc 3.2.3:

    CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
    -fno-omit-frame-pointer -felide-constructors -fno-exceptions
    -fno-rtti" ./configure --prefix=/usr/local/mysql
    --localstatedir=/usr/local/mysql/data --libexecdir=/usr/local/mysql/bin
    --with-extra-charsets=complex --enable-thread-safe-client
    --enable-local-infile --disable-shared --with-innodb
    
  • Sun Solaris 8 SPARC with gcc 3.2:

    CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
    -fno-omit-frame-pointer -felide-constructors -fno-exceptions
    -fno-rtti" ./configure --prefix=/usr/local/mysql
    --with-extra-charsets=complex --enable-thread-safe-client
    --enable-local-infile --enable-assembler --with-named-z-libs=no
    --with-named-curses-libs=-lcurses --disable-shared
    
  • Sun Solaris 8 SPARC 64-bit with gcc 3.2:

    CC=gcc CFLAGS="-O3 -m64 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
    -m64 -fno-omit-frame-pointer -felide-constructors -fno-exceptions
    -fno-rtti" ./configure --prefix=/usr/local/mysql
    --with-extra-charsets=complex --enable-thread-safe-client
    --enable-local-infile --with-named-z-libs=no
    --with-named-curses-libs=-lcurses --disable-shared
    
  • Sun Solaris 9 SPARC with gcc 2.95.3:

    CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
    -fno-omit-frame-pointer -felide-constructors -fno-exceptions
    -fno-rtti" ./configure --prefix=/usr/local/mysql
    --with-extra-charsets=complex --enable-thread-safe-client
    --enable-local-infile --enable-assembler --with-named-curses-libs=-lcurses
    --disable-shared
    
  • Sun Solaris 9 SPARC with (Sun Forte 5.0):

    CC=cc-5.0 CXX=CC ASFLAGS="-xarch=v9" CFLAGS="-Xa -xstrconst -mt
    -D_FORTEC_ -xarch=v9" CXXFLAGS="-noex -mt -D_FORTEC_ -xarch=v9"
    ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex
    --enable-thread-safe-client --enable-local-infile --enable-assembler
    --with-named-z-libs=no --enable-thread-safe-client --disable-shared
    
  • IBM AIX 4.3.2 ppc with gcc 3.2.3:

    CFLAGS="-O2 -mcpu=powerpc -Wa,-many " CXX=gcc CXXFLAGS="-O2
    -mcpu=powerpc -Wa,-many -felide-constructors -fno-exceptions
    -fno-rtti" ./configure --prefix=/usr/local/mysql
    --with-extra-charsets=complex --enable-thread-safe-client
    --enable-local-infile --with-named-z-libs=no --disable-shared
    
  • IBM AIX 4.3.3 ppc with (IBM Visual Age C/C++ 6.0):

    CC=xlc_r CFLAGS="-ma -O2 -qstrict -qoptimize=2 -qmaxmem=8192"
    CXX=xlC_r CXXFLAGS ="-ma -O2 -qstrict -qoptimize=2 -qmaxmem=8192"
    ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data
    --libexecdir=/usr/local/mysql/bin --with-extra-charsets=complex
    --enable-thread-safe-client --enable-local-infile --with-named-z-libs=no
    --disable-shared --with-innodb
    
  • IBM AIX 5.1.0 ppc with gcc 3.3:

    CFLAGS="-O2 -mcpu=powerpc -Wa,-many" CXX=gcc CXXFLAGS="-O2 -mcpu=powerpc
    -Wa,-many -felide-constructors -fno-exceptions -fno-rtti" ./configure
    --prefix=/usr/local/mysql --with-extra-charsets=complex
    --enable-thread-safe-client --enable-local-infile --with-named-z-libs=no
    --disable-shared
    
  • IBM AIX 5.2.0 ppc with (IBM Visual Age C/C++ 6.0):

    CC=xlc_r CFLAGS="-ma -O2 -qstrict -qoptimize=2 -qmaxmem=8192"
    CXX=xlC_r CXXFLAGS="-ma -O2 -qstrict -qoptimize=2 -qmaxmem=8192"
    ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data
    --libexecdir=/usr/local/mysql/bin --with-extra-charsets=complex
    --enable-thread-safe-client --enable-local-infile --with-named-z-libs=no
    --disable-shared --with-embedded-server --with-innodb
    
  • HP-UX 10.20 pa-risc1.1 with gcc 3.1:

    CFLAGS="-DHPUX -I/opt/dce/include -O3 -fPIC" CXX=gcc CXXFLAGS="-DHPUX
    -I/opt/dce /include -felide-constructors -fno-exceptions -fno-rtti
    -O3 -fPIC" ./configure --prefix=/usr/local/mysql
    --with-extra-charsets=complex --enable-thread-safe-client
    --enable-local-infile --with-pthread --with-named-thread-libs=-ldce
    --with-lib-ccflags=-fPIC --disable-shared
    
  • HP-UX 11.00 pa-risc with (HP ANSI C++ B3910B A.03.50):

    CC=cc CXX=aCC CFLAGS=+DAportable CXXFLAGS=+DAportable ./configure
    --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data
    --libexecdir=/usr/local/mysql/bin --with-extra-charsets=complex
    --enable-thread-safe-client --enable-local-infile --disable-shared
    --with-embedded-server --with-innodb
    
  • HP-UX 11.11 pa-risc2.0 64bit with (HP ANSI C++ B3910B A.03.33):

    CC=cc CXX=aCC CFLAGS=+DD64 CXXFLAGS=+DD64 ./configure
    --prefix=/usr/local/mysql --with-extra-charsets=complex
    --enable-thread-safe-client --enable-local-infile --disable-shared
    
  • HP-UX 11.11 pa-risc2.0 32bit with (HP ANSI C++ B3910B A.03.33):

    CC=cc CXX=aCC CFLAGS="+DAportable" CXXFLAGS="+DAportable" ./configure
    --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data
    --libexecdir=/usr/local/mysql/bin --with-extra-charsets=complex
    --enable-thread-safe-client --enable-local-infile --disable-shared
    --with-innodb
    
  • HP-UX 11.22 ia64 64bit with (HP aC++/ANSI C B3910B A.05.50):

    CC=cc CXX=aCC CFLAGS="+DD64 +DSitanium2" CXXFLAGS="+DD64 +DSitanium2"
    ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data
    --libexecdir=/usr/local/mysql/bin --with-extra-charsets=complex
    --enable-thread-safe-client --enable-local-infile --disable-shared
    --with-embedded-server --with-innodb
    
  • Apple Mac OS X 10.2 powerpc with gcc 3.1:

    CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
    -fno-omit-frame-pointer -felide-constructors -fno-exceptions
    -fno-rtti" ./configure --prefix=/usr/local/mysql
    --with-extra-charsets=complex --enable-thread-safe-client
    --enable-local-infile --disable-shared
    
  • FreeBSD 4.7 i386 with gcc 2.95.4:

    CFLAGS=-DHAVE_BROKEN_REALPATH ./configure --prefix=/usr/local/mysql
    --with-extra-charsets=complex --enable-thread-safe-client
    --enable-local-infile --enable-assembler --with-named-z-libs=not-used
    --disable-shared
    
  • FreeBSD 4.7 i386 using LinuxThreads with gcc 2.95.4:

    CFLAGS="-DHAVE_BROKEN_REALPATH -D__USE_UNIX98 -D_REENTRANT
    -D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads"
    CXXFLAGS="-DHAVE_BROKEN_REALPATH -D__USE_UNIX98 -D_REENTRANT
    -D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads" ./configure
    --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data
    --libexecdir=/usr/local/mysql/bin --enable-thread-safe-client
    --enable-local-infile --enable-assembler
    --with-named-thread-libs="-DHAVE_GLIBC2_STYLE_GETHOSTBYNAME_R
    -D_THREAD_SAFE -I /usr/local/include/pthread/linuxthreads
    -L/usr/local/lib -llthread -llgcc_r" --disable-shared
    --with-embedded-server --with-innodb
    
  • QNX Neutrino 6.2.1 i386 with gcc 2.95.3qnx-nto 20010315:

    CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
    -fno-omit-frame-pointer -felide-constructors -fno-exceptions
    -fno-rtti" ./configure --prefix=/usr/local/mysql
    --with-extra-charsets=complex --enable-thread-safe-client
    --enable-local-infile --disable-shared
    

The following binaries are built on third-party systems kindly provided to MySQL AB by other users. These are provided only as a courtesy; MySQL AB does not have full control over these systems, so we can provide only limited support for the binaries built on them.

  • SCO Unix 3.2v5.0.7 i386 with gcc 2.95.3:

    CFLAGS="-O3 -mpentium" LDFLAGS=-static CXX=gcc CXXFLAGS="-O3 -mpentium
    -felide-constructors" ./configure --prefix=/usr/local/mysql
    --with-extra-charsets=complex --enable-thread-safe-client
    --enable-local-infile --with-named-z-libs=no --enable-thread-safe-client
    --disable-shared
    
  • SCO UnixWare 7.1.4 i386 with CC 3.2:

    CC=cc CFLAGS="-O" CXX=CC ./configure --prefix=/usr/local/mysql
    --with-extra-charsets=complex --enable-thread-safe-client
    --enable-local-infile --with-named-z-libs=no --enable-thread-safe-client
    --disable-shared --with-readline
    
  • SCO OpenServer 6.0.0 i386 with CC 3.2:

    CC=cc CFLAGS="-O" CXX=CC ./configure --prefix=/usr/local/mysql
    --with-extra-charsets=complex --enable-thread-safe-client
    --enable-local-infile --with-named-z-libs=no --enable-thread-safe-client
    --disable-shared --with-readline
    
  • Compaq Tru64 OSF/1 V5.1 732 alpha with (Compaq C V6.3-029i / DIGITAL C++ V6.1-027):

    CC="cc -pthread" CFLAGS="-O4 -ansi_alias -ansi_args -fast -inline
    speed -speculate all" CXX="cxx -pthread" CXXFLAGS="-O4 -ansi_alias
    -fast -inline speed -speculate all -noexceptions -nortti" ./configure
    --prefix=/usr/local/mysql --with-extra-charsets=complex
    --enable-thread-safe-client --enable-local-infile
    --with-named-thread-libs="-lpthread -lmach -lexc -lc" --disable-shared
    --with-mysqld-ldflags=-all-static
    
  • SGI Irix 6.5 IP32 with gcc 3.0.1:

    CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXXFLAGS="-O3
    -fno-omit-frame-pointer -felide-constructors -fno-exceptions
    -fno-rtti" ./configure --prefix=/usr/local/mysql
    --with-extra-charsets=complex --enable-thread-safe-client
    --enable-local-infile --disable-shared
    
  • FreeBSD/sparc64 5.0 with gcc 3.2.1:

    CFLAGS=-DHAVE_BROKEN_REALPATH ./configure --prefix=/usr/local/mysql
    --localstatedir=/usr/local/mysql/data --libexecdir=/usr/local/mysql/bin
    --with-extra-charsets=complex --enable-thread-safe-client
    --enable-local-infile --disable-shared --with-innodb
    

The following compile options have been used for binary packages that MySQL AB provided in the past. These binaries no longer are being updated, but the compile options are listed here for reference purposes.

  • Linux 2.2.xx SPARC with egcs 1.1.2:

    CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
    -fno-omit-frame-pointer -felide-constructors -fno-exceptions
    -fno-rtti" ./configure --prefix=/usr/local/mysql
    --with-extra-charsets=complex --enable-thread-safe-client
    --enable-local-infile --enable-assembler --disable-shared
    
  • Linux 2.2.x with x686 with gcc 2.95.2:

    CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro
    -felide-constructors -fno-exceptions -fno-rtti" ./configure
    --prefix=/usr/local/mysql --enable-assembler
    --with-mysqld-ldflags=-all-static --disable-shared
    --with-extra-charsets=complex
    
  • SunOS 4.1.4 2 sun4c with gcc 2.7.2.1:

    CC=gcc CXX=gcc CXXFLAGS="-O3 -felide-constructors" ./configure
    --prefix=/usr/local/mysql --disable-shared --with-extra-charsets=complex
    --enable-assembler
    
  • SunOS 5.5.1 (and above) sun4u with egcs 1.0.3a or 2.90.27 or gcc 2.95.2 and newer:

    CC=gcc CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors
    -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql
    --with-low-memory --with-extra-charsets=complex --enable-assembler
    
  • SunOS 5.6 i86pc with gcc 2.8.1:

    CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql
    --with-low-memory --with-extra-charsets=complex
    
  • BSDI BSD/OS 3.1 i386 with gcc 2.7.2.1:

    CC=gcc CXX=gcc CXXFLAGS=-O ./configure --prefix=/usr/local/mysql
    --with-extra-charsets=complex
    
  • BSDI BSD/OS 2.1 i386 with gcc 2.7.2:

    CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql
    --with-extra-charsets=complex
    
  • AIX 4.2 with gcc 2.7.2.2:

    CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql
    --with-extra-charsets=complex
    

2.1.3. How to Get MySQL

Check our downloads page at http://dev.mysql.com/downloads/ for information about the current version of MySQL and for downloading instructions. For a complete up-to-date list of MySQL download mirror sites, see http://dev.mysql.com/downloads/mirrors.html. You can also find information there about becoming a MySQL mirror site and how to report a bad or out-of-date mirror.

Our main mirror is located at http://mirrors.sunsite.dk/mysql/.

2.1.4. Verifying Package Integrity Using MD5 Checksums or GnuPG

After you have downloaded the MySQL package that suits your needs and before you attempt to install it, you should make sure that it is intact and has not been tampered with. MySQL AB offers three means of integrity checking:

  • MD5 checksums

  • Cryptographic signatures using , the GNU Privacy Guard

  • For RPM packages, the built-in RPM integrity verification mechanism

The following sections describe how to use these methods.

If you notice that the MD5 checksum or GPG signatures do not match, first try to download the respective package one more time, perhaps from another mirror site. If you repeatedly cannot successfully verify the integrity of the package, please notify us about such incidents, including the full package name and the download site you have been using, at or . Do not report downloading problems using the bug-reporting system.

2.1.4.1. Verifying the MD5 Checksum

After you have downloaded a MySQL package, you should make sure that its MD5 checksum matches the one provided on the MySQL download pages. Each package has an individual checksum that you can verify with the following command, where is the name of the package you downloaded:

shell> 

Example:

shell> 
aaab65abbec64d5e907dcd41b8699945  mysql-standard-5.0.25-linux-i686.tar.gz

You should verify that the resulting checksum (the string of hexadecimal digits) matches the one displayed on the download page immediately below the respective package.

Note: Make sure to verify the checksum of the archive file (for example, the or file) and not of the files that are contained inside of the archive.

Note that not all operating systems support the md5sum command. On some, it is simply called md5, and others do not ship it at all. On Linux, it is part of the GNU Text Utilities package, which is available for a wide range of platforms. You can download the source code from http://www.gnu.org/software/textutils/ as well. If you have OpenSSL installed, you can use the command openssl md5 instead. A Windows implementation of the md5 command line utility is available from http://www.fourmilab.ch/md5/. winMd5Sum is a graphical MD5 checking tool that can be obtained from http://www.nullriver.com/index/products/winmd5sum.

2.1.4.2. Signature Checking Using

Another method of verifying the integrity and authenticity of a package is to use cryptographic signatures. This is more reliable than using MD5 checksums, but requires more work.

At MySQL AB, we sign MySQL downloadable packages with GnuPG (GNU Privacy Guard). GnuPG is an Open Source alternative to the well-known Pretty Good Privacy (PGP) by Phil Zimmermann. See http://www.gnupg.org/ for more information about GnuPG and how to obtain and install it on your system. Most Linux distributions ship with GnuPG installed by default. For more information about GnuPG, see http://www.openpgp.org/.

To verify the signature for a specific package, you first need to obtain a copy of MySQL AB's public GPG build key, which you can download from http://www.keyserver.net/. The key that you want to obtain is named . Alternatively, you can cut and paste the key directly from the following text:

Key ID:
pub  1024D/5072E1F5 2003-02-03
     MySQL Package signing key (www.mysql.com) <[email protected]>
Fingerprint: A4A9 4068 76FC BD3C 4567  70C8 8C71 8D3B 5072 E1F5

Public Key (ASCII-armored):

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

mQGiBD4+owwRBAC14GIfUfCyEDSIePvEW3SAFUdJBtoQHH/nJKZyQT7h9bPlUWC3
RODjQReyCITRrdwyrKUGku2FmeVGwn2u2WmDMNABLnpprWPkBdCk96+OmSLN9brZ
fw2vOUgCmYv2hW0hyDHuvYlQA/BThQoADgj8AW6/0Lo7V1W9/8VuHP0gQwCgvzV3
BqOxRznNCRCRxAuAuVztHRcEAJooQK1+iSiunZMYD1WufeXfshc57S/+yeJkegNW
hxwR9pRWVArNYJdDRT+rf2RUe3vpquKNQU/hnEIUHJRQqYHo8gTxvxXNQc7fJYLV
K2HtkrPbP72vwsEKMYhhr0eKCbtLGfls9krjJ6sBgACyP/Vb7hiPwxh6rDZ7ITnE
kYpXBACmWpP8NJTkamEnPCia2ZoOHODANwpUkP43I7jsDmgtobZX9qnrAXw+uNDI
QJEXM6FSbi0LLtZciNlYsafwAPEOMDKpMqAK6IyisNtPvaLd8lH0bPAnWqcyefep
rv0sxxqUEMcM3o7wwgfN83POkDasDbs3pjwPhxvhz6//62zQJ7Q7TXlTUUwgUGFj
a2FnZSBzaWduaW5nIGtleSAod3d3Lm15c3FsLmNvbSkgPGJ1aWxkQG15c3FsLmNv
bT6IXQQTEQIAHQUCPj6jDAUJCWYBgAULBwoDBAMVAwIDFgIBAheAAAoJEIxxjTtQ
cuH1cY4AnilUwTXn8MatQOiG0a/bPxrvK/gCAJ4oinSNZRYTnblChwFaazt7PF3q
zIhMBBMRAgAMBQI+PqPRBYMJZgC7AAoJEElQ4SqycpHyJOEAn1mxHijft00bKXvu
cSo/pECUmppiAJ41M9MRVj5VcdH/KN/KjRtW6tHFPYhMBBMRAgAMBQI+QoIDBYMJ
YiKJAAoJELb1zU3GuiQ/lpEAoIhpp6BozKI8p6eaabzF5MlJH58pAKCu/ROofK8J
Eg2aLos+5zEYrB/LsrkCDQQ+PqMdEAgA7+GJfxbMdY4wslPnjH9rF4N2qfWsEN/l
xaZoJYc3a6M02WCnHl6ahT2/tBK2w1QI4YFteR47gCvtgb6O1JHffOo2HfLmRDRi
Rjd1DTCHqeyX7CHhcghj/dNRlW2Z0l5QFEcmV9U0Vhp3aFfWC4Ujfs3LU+hkAWzE
7zaD5cH9J7yv/6xuZVw411x0h4UqsTcWMu0iM1BzELqX1DY7LwoPEb/O9Rkbf4fm
Le11EzIaCa4PqARXQZc4dhSinMt6K3X4BrRsKTfozBu74F47D8Ilbf5vSYHbuE5p
/1oIDznkg/p8kW+3FxuWrycciqFTcNz215yyX39LXFnlLzKUb/F5GwADBQf+Lwqq
a8CGrRfsOAJxim63CHfty5mUc5rUSnTslGYEIOCR1BeQauyPZbPDsDD9MZ1ZaSaf
anFvwFG6Llx9xkU7tzq+vKLoWkm4u5xf3vn55VjnSd1aQ9eQnUcXiL4cnBGoTbOW
I39EcyzgslzBdC++MPjcQTcA7p6JUVsP6oAB3FQWg54tuUo0Ec8bsM8b3Ev42Lmu
QT5NdKHGwHsXTPtl0klk4bQk4OajHsiy1BMahpT27jWjJlMiJc+IWJ0mghkKHt92
6s/ymfdf5HkdQ1cyvsz5tryVI3Fx78XeSYfQvuuwqp2H139pXGEkg0n6KdUOetdZ
Whe70YGNPw1yjWJT1IhMBBgRAgAMBQI+PqMdBQkJZgGAAAoJEIxxjTtQcuH17p4A
n3r1QpVC9yhnW2cSAjq+kr72GX0eAJ4295kl6NxYEuFApmr1+0uUq/SlsQ==
=YJkx
-----END PGP PUBLIC KEY BLOCK-----

To import the build key into your personal public GPG keyring, use gpg --import. For example, if you have saved the key in a file named , the import command looks like this:

shell> 

After you have downloaded and imported the public build key, download your desired MySQL package and the corresponding signature, which also is available from the download page. The signature file has the same name as the distribution file with an extension. For example:

Distribution file
Signature file

Make sure that both files are stored in the same directory and then run the following command to verify the signature for the distribution file:

shell> .asc

Example:

shell> 
gpg: Signature made Tue 12 Jul 2005 23:35:41 EST using DSA key ID 5072E1F5
gpg: Good signature from "MySQL Package signing key (www.mysql.com) <[email protected]>"

The message indicates that everything is all right. You can ignore any warning you might obtain.

See the GPG documentation for more information on how to work with public keys.

2.1.4.3. Signature Checking Using

For RPM packages, there is no separate signature. RPM packages have a built-in GPG signature and MD5 checksum. You can verify a package by running the following command:

shell> .rpm

Example:

shell> 
MySQL-server-5.0.25-0.i386.rpm: md5 gpg OK

Note: If you are using RPM 4.1 and it complains about , even though you have imported the MySQL public build key into your own GPG keyring, you need to import the key into the RPM keyring first. RPM 4.1 no longer uses your personal GPG keyring (or GPG itself). Rather, it maintains its own keyring because it is a system-wide application and a user's GPG public keyring is a user-specific file. To import the MySQL public key into the RPM keyring, first obtain the key as described in Section 2.1.4.2, “Signature Checking Using . Then use rpm --import to import the key. For example, if you have saved the public key in a file named , import it using this command:

shell> 

If you need to obtain the MySQL public key, see Section 2.1.4.2, “Signature Checking Using .

2.1.5. Installation Layouts

This section describes the default layout of the directories created by installing binary or source distributions provided by MySQL AB. A distribution provided by another vendor might use a layout different from those shown here.

For MySQL 5.0 on Windows, the default installation directory is . (Some Windows users prefer to install in , the directory that formerly was used as the default. However, the layout of the subdirectories remains the same.) The installation directory has the following subdirectories:

Directory Contents of Directory
Client programs and the mysqld server
Log files, databases
Documentation
Example programs and scripts
Include (header) files
Libraries
Utility scripts
Error message files

Installations created from MySQL AB's Linux RPM distributions result in files under the following system directories:

Directory Contents of Directory
Client programs and scripts
The mysqld server
Log files, databases
Documentation
Include (header) files
Libraries
Error message and character set files
Benchmarks

On Unix, a tar file binary distribution is installed by unpacking it at the installation location you choose (typically ) and creates the following directories in that location:

Directory Contents of Directory
Client programs and the mysqld server
Log files, databases
Documentation, ChangeLog
Include (header) files
Libraries
mysql_install_db
Error message files
Benchmarks

A source distribution is installed after you configure and compile it. By default, the installation step installs files under , in the following subdirectories:

Directory Contents of Directory
Client programs and scripts
Include (header) files
Documentation in Info format
Libraries
The mysqld server
Error message files
Benchmarks and test
Databases and log files

Within its installation directory, the layout of a source installation differs from that of a binary installation in the following ways:

  • The mysqld server is installed in the directory rather than in the directory.

  • The data directory is rather than .

  • mysql_install_db is installed in the directory rather than in the directory.

  • The header file and library directories are and rather than and .

You can create your own binary installation from a compiled source distribution by executing the script from the top directory of the source distribution.