This chapter describes how to obtain and install MySQL:
GnuPG.
The last part of the chapter provides information on system-specific problems you may run into.
Before installing MySQL, you should do the following:
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.
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 suport 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.
glibc 2.0.7+. See section 2.6.1 Linux Notes.
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:
pthread_mutex_lock() is too anxious to yield CPU time, this will hurt
MySQL tremendously. If this issue is not taken care of, adding extra CPUs
will actually make MySQL slower.
Based on the preceding criteria, the best platforms for running MySQL at this point are x86 with SuSE Linux 8.2, 2.4 kernel, and ReiserFS (or any similar Linux distribution) and SPARC with Solaris (2.7-9). FreeBSD comes third, but we really hope it will join the top club once the thread library is improved. We also hope that at some point we will be able to include into the top category all other platforms on which MySQL currently compiles and runs okay, but not quite with the same level of stability and performance. This will require some effort on our part in cooperation with the developers of the operating system 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 internals mailing list. See section 1.7.1.1 The 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 would be different if we considered more factors. And in some cases, the reason one OS is better than the other could simply be that we have put forth more effort into testing on and optimizing for that particular platform. We are just stating our observations to help you decide which platform to use MySQL in your setup.
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.
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:
We don't believe in a complete freeze, as this also leaves out bug fixes and things that ``must be done.'' ``Somewhat frozen'' means that we may add small things that ``almost surely will not affect anything that's already working.'' Naturally, relevant bugfixes from an earlier series propagate to later series.
The MySQL naming scheme uses release names that consist of three
numbers and a suffix, for example, mysql-4.1.0-alpha.
The numbers within the release name are is interpreted like this:
4) is the major version and also describes the
file format. All Version 4 releases have the same file format.
1) is the release level.
Taken together, the major version and release level constitute the release
series number.
0) 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 some large section of
new code that hasn't been 100% tested. Known bugs (usually there are none)
should be documented in the News section. See section C MySQL Change History. There are also new
commands and extensions in most alpha releases. Active development that
may involve major code changes can occur in an alpha release, but everything
will be tested before issuing a release. For this reason, there should be
no known bugs in any MySQL release.
beta means that all new code has been tested. No major new
features that could cause corruption in old code are added. There should
be no known bugs. A version changes from alpha to beta when there
haven't been any reported fatal bugs within an alpha version for at least
a month and we have no plans to add any features that could make any old
command unreliable.
gamma is a beta that has been around a while and seems to work fine.
Only minor fixes are added. This is what many other companies call a release.
MySQL uses a naming scheme that is slightly different from most other products. In general, it's relatively safe to use any version that has been out for a couple of weeks without being replaced with a new version within the 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.
Note that all releases have been tested at least with:
crash-me test
Another test is that we use the newest MySQL version in our internal production environment, on at least one machine. We have more than 100 gigabytes of data to work with.
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 DMG package installers for
Mac OS X. Distributions also are available as Zip archives or compressed
tar files.
Reasons to choose a binary distribution include the following:
-max suffix and is configured with the same options as
mysqld-max. See section 5.1.2 The mysqld-max Extended MySQL Server.
If you want to use the MySQL-Max RPM, you must first
install the standard MySQL-server RPM.
Circumstances under which you probably will be better off with a source installation include the following:
mysqld with some extra features that are
not in the standard binary distributions. Here is a list of the most
common extra options that you may want to use:
--with-innodb (default for MySQL 4.0 and onwards)
--with-berkeley-db (not available on all platforms)
--with-raid
--with-libwrap
--with-named-z-libs (This is done for some of the binaries)
--with-debug[=full]
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.
pgcc) 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.
MySQL is evolving quite rapidly here at MySQL AB and we want to share new developments with other MySQL users. We try to make a release when we have very useful features that others seem to have a need for.
We also try to help out users who request features that are easy to implement. We take note of what our licensed users want to have, and we especially take note of what our extended email supported customers want and try to help them out.
No one has to download a new release. The News section will tell you if the new release has something you really want. See section C MySQL Change History.
We use the following policy when updating MySQL:
We put a lot of time and effort into making our releases bug free. To our knowledge, we have not released a single MySQL version with any known ``fatal'' repeatable bugs. (A fatal bug is something that crashes MySQL under normal usage, produces incorrect answers for normal queries, or has a security problem.)
We have documented all open problems, bugs, and issues that are dependent on design decisions. See section 1.8.7 Known Errors and Design Deficiencies in MySQL.
Our aim is to fix everything that is fixable without risk of 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.
Here is a description of how our build process works:
mysql and announce mailing
lists.
See section 1.7.1.1 The 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 only been needed
in a handful of releases.)
'a' release
for that platform. Thanks to our large user base, problems are found
quickly.
glibc library on one of our build
machines that took us a long time to track down).
As a service, we at MySQL AB 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
(see section 2.2 Standard MySQL Installation Using a Binary Distribution), we do offer binary distributions
for a number of platforms in the form of of compressed tar files
(.tar.gz).
These distributions are generated using the script
Build-tools/Do-compile which compiles the source code and creates the
binary tar.gz 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
COMP_ENV_INFO and CONFIGURE_LINE inside the script
bin/mysqlbug of every binary tar file distribution.
Binaries built on MySQL AB development systems:
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
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
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
ccc (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
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
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
gcc 3.2.1:
CXX=gcc ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --disable-shared
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
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
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 --enable-assembler --with-named-z-libs=no --with-named-curses-libs=-lcurses --disable-shared
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
cc-5.0 (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
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
xlC_r (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
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
xlC_r (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
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
aCC (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
aCC (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
aCC (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
aCC (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
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
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
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
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. Please note that these are only provided as a courtesy. Since MySQL AB does not have full control over these systems, we can provide only limited support for the binaries built on these systems.
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
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
cc/cxx (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-prefix=/usr/local/mysql --with-named-thread-libs="-lpthread -lmach -lexc -lc" --disable-shared --with-mysqld-ldflags=-all-static
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
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 MySQL AB used to provide in the past. These binaries are no longer being updated, but the compile options are listed here for reference purposes.
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
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
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
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
gcc 2.8.1:
CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-low-memory --with-extra-charsets=complex
gcc 2.7.2.1:
CC=gcc CXX=gcc CXXFLAGS=-O ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex
gcc 2.7.2:
CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex
gcc 2.7.2.2:
CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex
Anyone who has more optimal options for any of the preceding configurations listed can always mail them to the MySQL internals mailing list. See section 1.7.1.1 The MySQL Mailing Lists.
RPM distributions prior to MySQL Version 3.22 are user-contributed. Beginning with Version 3.22, the RPM distributions are generated by us at MySQL AB.
If you want to compile a debug version of MySQL, you should add
--with-debug or --with-debug=full to the preceding configure lines
and remove any -fomit-frame-pointer options.
For the Windows distribution, please see section 2.2.1 Installing MySQL on Windows.
Check the MySQL homepage (http://www.mysql.com/) for information about the current version and for downloading instructions.
Our main mirror is located at http://mirrors.sunsite.dk/mysql/.
For a complete up-to-date list of MySQL Web/download mirrors, see http://www.mysql.com/downloads/mirrors.html. There you will also find information about becoming a MySQL mirror site and how to report a bad or out of date mirror.
GnuPGAfter you have downloaded the MySQL package that suits your needs and before you attempt to install it, you should make sure it is intact and has not been tampered with.
MySQL AB offers three means of integrity checking:
GnuPG, the GNU Privacy Guard
The following sections describe how to use these methods.
MD5 Checksum
After you have downloaded the package, you should make sure that the 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 package_name is the name of the package you downloaded:
shell> md5sum package_name
Note, that not all operating systems support the md5sum command--on
some it is simply called md5, 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 also use the command openssl md5
package_name instead. A DOS/Windows implementation of the md5 command
is available from http://www.fourmilab.ch/md5/.
Example:
shell> md5sum mysql-standard-4.0.17-pc-linux-i686.tar.gz
60f5fe969d61c8f82e4f7f62657e1f06
mysql-standard-4.0.17-pc-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.
GnuPGAnother 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.
Beginning with MySQL 4.0.10 (February 2003), MySQL AB started signing
downloadable packages with GnuPG (GNU Privacy Guard).
GnuPG is an Open Source alternative to the very 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
already ship with GnuPG installed by default. For more information
about OpenPGP, 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 build@mysql.com. You can either cut and paste it directly from here, or obtain it from http://www.keyserver.net/.
Key ID:
pub 1024D/5072E1F5 2003-02-03
MySQL Package signing key (www.mysql.com) <build@mysql.com>
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-----
You can import this key into your personal public GPG keyring by using
gpg --import. See the GPG documentation for more info
on how to work with public keys.
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 `.asc' extension. For example:
| Distribution file | mysql-standard-4.0.17-pc-linux-i686.tar.gz
|
| Signature file | mysql-standard-4.0.17-pc-linux-i686.tar.gz.asc
|
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> gpg --verify package_name.asc
Example:
shell> gpg --verify mysql-standard-4.0.17-pc-linux-i686.tar.gz.asc
gpg: Warning: using insecure memory!
gpg: Signature made Mon 03 Feb 2003 08:50:39 PM MET using DSA key ID 5072E1F5
gpg: Good signature from
"MySQL Package signing key (www.mysql.com) <build@mysql.com>"
The ``Good signature'' message indicates that everything is all right.
RPMFor RPM packages, there is no separate signature. RPM packages actually have a built-in GPG signature and MD5 checksum. You can verify a package by running the following command:
shell> rpm --checksig package_name.rpm
Example:
shell> rpm --checksig MySQL-server-4.0.10-0.i386.rpm MySQL-server-4.0.10-0.i386.rpm: md5 gpg OK
Note: If you are using RPM 4.1 and it complains about (GPG)
NOT OK (MISSING KEYS: GPG#5072e1f5) (even though you have imported it into
your own GPG public keyring), you need to import the key into the RPM
keyring first. RPM 4.1 no longer uses your personal GPG keyring (and GPG
itself), but rather maintains its own keyring (because it's 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, use rpm --import.
For example, if you have the public key stored in a file named `mysql_pubkey.asc', import it using this command:
shell> rpm --import mysql_pubkey.asc
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 webmaster@mysql.com or build@mysql.com. Do not report downloading problems using the bug-reporting system.
This section describes the default layout of the directories created by installing binary and source distributions.
On Windows, the default installation directory is `C:\mysql', which has the following subdirectories:
| Directory | Contents of Directory |
| `bin' | Client programs and the mysqld server
|
| `data' | Log files, databases |
| `Docs' | Documentation |
| `examples' | Example programs and scripts |
| `include' | Include (header) files |
| `lib' | Libraries |
| `scripts' | Utility scripts |
| `share' | Error message files |
Installations created from Linux RPM distributions result in files under the following system directories:
| Directory | Contents of Directory |
| `/usr/bin' | Client programs |
| `/usr/sbin' | mysqld server
|
| `/var/lib/mysql' | Log files, databases |
| `/usr/share/doc/packages' | Documentation |
| `include' | Include (header) files |
| `lib' | Libraries |
| `scripts' | mysql_install_db
|
| `/usr/share/mysql' | Error message and character set files |
| `sql-bench' | Benchmarks |
On Unix, a tar file
binary distribution is installed by unpacking it at the installation
location you choose (typically `/usr/local/mysql') and creates the
following directories in that location:
| Directory | Contents of Directory |
| `bin' | Client programs and the mysqld server
|
| `data' | Log files, databases |
| `docs' | Documentation, ChangeLog |
| `include' | Include (header) files |
| `lib' | Libraries |
| `scripts' | mysql_install_db
|
| `share/mysql' | Error message files |
| `sql-bench' | Benchmarks |
A source distribution is installed after you configure and compile it. By default, the installation step installs files under `/usr/local', in the following subdirectories:
| Directory | Contents of Directory |
| `bin' | Client programs and scripts |
| `include/mysql' | Include (header) files |
| `info' | Documentation in Info format |
| `lib/mysql' | Libraries |
| `libexec' | The mysqld server
|
| `share/mysql' | Error message files |
| `sql-bench' | Benchmarks and crash-me test
|
| `var' | Databases and log files |
Within an installation directory, the layout of a source installation differs from that of a binary installation in the following ways:
mysqld server is installed in the `libexec'
directory rather than in the `bin' directory.
mysql_install_db is installed in the `bin' directory
rather than in the `scripts' directory.
You can create your own binary installation from a compiled source distribution by executing the `scripts/make_binary_distribution' script from the top directory of the source distribution.
This section covers the installation of MySQL on platforms where we offer packages using the native packaging format of the respective platform. (This is also known as performing a ``binary install.'') However, binary distributions of MySQL are available for many other platforms as well. See section 2.2.5 Installing MySQL on Other Unix-like Systems for generic installation instructions for these packages that apply to all platforms.
See section 2.1 General Installation Issues for more information on what other binary distributions are available and how to obtain them.
The installation process for MySQL on Windows has the following steps:
MySQL for Windows is available in two distribution formats:
Generally speaking, you should use the binary distribution. It's simpler, and you need no additional tools to get MySQL up and running.
This section describes how to install MySQL on Windows using a binary distribution. To install using a source distribution, see section 2.3.6 Installing MySQL from Source on Windows.
To run MySQL on Windows, you need the following:
ZIP program to unpack the distribution file.
MyODBC driver. See section 20.3 MySQL ODBC Support.
MAX_ROWS and
AVG_ROW_LENGTH when you create tables.
See section 14.2.5 CREATE TABLE Syntax.
To install MySQL on Windows using a binary distribution, follow this procedure:
C:\> NET STOP MySQLIf you plan to use a different server after the upgrade (for example, if you want to run
mysqld-max rather than mysqld),
remove the existing service:
C:\mysql\bin> mysqld --removeYou can reinstall the service to use the proper server after upgrading. If you are not running the MySQL server as a service, stop it like this:
C:\mysql\bin> mysqladmin -u root shutdown
WinMySQLAdmin program if it is running.
setup.exe program to begin the installation process.
If you want to install MySQL into a location other than the default directory
(`C:\mysql'), use the Browse button to specify your
preferred directory. If you do not install MySQL into the default location,
you will need to specify the location whenever you start the server. The
easiest way to do this is to use an option file, as described in
section 2.2.1.3 Preparing the Windows MySQL Environment.
Important note:
Early alpha Windows distributions for MySQL 4.1 do not contain any
installer program. A 4.1 distribution is a ZIP file that you just
unzip in the location where you want to install MySQL. For example,
to install `mysql-4.1.1-alpha-win.zip' as `C:\mysql', unzip
the distribution file on the C: drive, then rename the resulting
`mysql-4.1.1-alpha' directory to `mysql'.
If you are upgrading to MySQL 4.1 from an earlier version, you will want to
preserve your existing `data' directory that contains the grant tables
in the mysql database and your own databases. Before installing 4.1,
stop the server if it is running, and save your `data' directory to
another location. Then either rename the existing `C:\mysql' directory
or remove it. Install 4.1 as described in the preceding paragraph, and then
replace its `data' directory with your old `data' directory.
Start the new server and update the grant tables. This will avoid loss of
your current databases.
See section 2.5.8 Upgrading the Grant Tables.
If you need to specify startup options when you run the server, you can indicate them on the command line or place them in an option file. For options that will be used every time the server starts, you will find it most convenient to use an option file to specify your MySQL configuration. This is true particularly under the following circumstances:
InnoDB transactional tables in
MySQL version 3.23, you
must manually create two new directories to hold the InnoDB
data and log files--such as, `C:\ibdata' and `C:\iblogs'.
You will also need to add some extra lines to the option
file, as described in section 16.4 InnoDB Configuration.
(As of MySQL 4.0, InnoDB creates its datafiles and log files in the data
directory by default. This means you need not configure InnoDB explicitly.
You may still do so if you wish, and an option file will be useful in this
case, too.)
On Windows, the MySQL installer places the data directory directly under the directory where you install MySQL. If you would like to use a data directory in a different location, you should copy the entire contents of the `data' directory to the new location. For example, by default, the installer places MySQL in `C:\mysql' and the data directory in `C:\mysql\data'. If you want to use a data directory of `E:\mydata', you must do two things:
--datadir option to specify the new data directory location
each time you start the server.
When the MySQL server starts on Windows, it looks for options in
two files: The `my.ini' file in the Windows directory, and
the `C:\my.cnf' file. The Windows directory typically is
named something like `C:\WINDOWS' or `C:\WinNT'. You
can determine its exact location from the value of the WINDIR
environment variable using the following command:
C:\> echo %WINDIR%
MySQL looks for options first in the `my.ini' file, then in
the `my.cnf' file. However, to avoid confusion, it's best if
you use only one file. If your PC uses a boot loader where the
C: drive isn't the boot drive, your only option is to use
the `my.ini' file. Whichever one you use, it must be a plain
text file.
An option file can be created and modified with any text editor,
such as the Notepad program. For example, if MySQL is
installed at `D:\mysql' and the data directory is located as
`D:\mydata\data', you can create the option file and set up
a [mysqld] section to specify values for the basedir
and datadir parameters:
[mysqld] # set basedir to your installation path basedir=D:/mysql # set datadir to the location of your data directory datadir=D:/mydata/data
Note that Windows pathnames are specified in option files using forward slashes rather than backslashes. If you do use backslashes, you must double them.
Another way to manage an option file is to use the WinMySQLAdmin
tool. You can find WinMySQLAdmin in the `bin' directory
of your MySQL installation, as well as a help file containing
instructions for using it. WinMySQLAdmin has the capability
of editing your option file, but note these points:
WinMySQLAdmin uses only the `my.ini' file.
WinMySQLAdmin finds a `C:\my.cnf' file, it will in fact rename
it to `C:\my_cnf.bak' to disable it.
Now you are ready to test starting the server.
Starting with MySQL 3.23.38, the Windows distribution includes both the normal and the MySQL-Max server binaries. Here is a list of the different MySQL servers from which you can choose:
| Binary | Description |
mysqld | Compiled with full debugging and automatic memory allocation checking, symbolic links, and InnoDB and BDB tables.
|
mysqld-opt | Optimized binary. From version 4.0 on, InnoDB is enabled. Before 4.0, this server includes no transactional table support.
|
mysqld-nt | Optimized binary for NT/2000/XP with support for named pipes. |
mysqld-max | Optimized binary with support for symbolic links, and InnoDB and BDB tables.
|
mysqld-max-nt | Like mysqld-max, but compiled with support for named pipes.
|
All of the preceding binaries are optimized for modern Intel processors but should work on any Intel i386-class or higher processor.
MySQL supports TCP/IP on all Windows platforms. The mysqld-nt
and mysql-max-nt servers support named pipes on NT, 2000, and XP.
However, the default is to use TCP/IP regardless of the platform.
(Named pipes are slower than TCP/IP in many Windows configurations.)
Named pipe use is subject to these conditions:
--enable-named-pipe option.
It is now necessary to use this option explicitly because some users have
experienced problems shutting down the MySQL server when named pipes
are used.
mysqld-nt or mysqld-max-nt servers, and only if the server is
run on a version of Windows that supports named pipes (NT, 2000, XP).
On Windows 95, 98, or Me, MySQL clients always connect to the server using TCP/IP. (This will allow any machine on your network to connect to your MySQL server.) Because of this, you must make sure that TCP/IP support is installed on your machine before starting MySQL. You can find TCP/IP on your Windows CD-ROM.
Note that if you are using an old Windows 95 release (for example, OSR2), it's likely that you have an old Winsock package; MySQL requires Winsock 2! You can get the newest Winsock from http://www.microsoft.com/. Windows 98 has the new Winsock 2 library, so it is unnecessary to update the library.
On NT-based systems such as Windows NT, 2000, or XP, clients have two options. They can use TCP/IP, or they can use a named pipe if the server supports named pipe connections.
For information about which server binary to run, see section 2.2.1.3 Preparing the Windows MySQL Environment.
This section gives a general overview of starting the MySQL server. The following sections provide more specific information for particular versions of Windows.
The examples in these sections assume that MySQL is installed under the default location of `C:\mysql'. Adjust the pathnames shown in the examples if you have MySQL installed in a different location.
Testing is best done from a command prompt in a console window (a ``DOS window''). This way you can have the server display status messages in the window where they are easy to see. If something is wrong with your configuration, these messages will make it easier for you to identify and fix any problems.
Make sure you are in the directory where the server is located, then enter this command:
C:\mysql\bin> mysqld --console
For servers that include InnoDB support,
you should see the following messages as the server starts:
InnoDB: The first specified datafile c:\ibdata\ibdata1 did not exist: InnoDB: a new database to be created! InnoDB: Setting file c:\ibdata\ibdata1 size to 209715200 InnoDB: Database physically writes the file full: wait... InnoDB: Log file c:\iblogs\ib_logfile0 did not exist: new to be created InnoDB: Setting log file c:\iblogs\ib_logfile0 size to 31457280 InnoDB: Log file c:\iblogs\ib_logfile1 did not exist: new to be created InnoDB: Setting log file c:\iblogs\ib_logfile1 size to 31457280 InnoDB: Log file c:\iblogs\ib_logfile2 did not exist: new to be created InnoDB: Setting log file c:\iblogs\ib_logfile2 size to 31457280 InnoDB: Doublewrite buffer not found: creating new InnoDB: Doublewrite buffer created InnoDB: creating foreign key constraint system tables InnoDB: foreign key constraint system tables created 011024 10:58:25 InnoDB: Started
When the server finishes its startup sequence, you should see something like this, which indicates that the server is ready to service client connections:
mysqld: ready for connections Version: '4.0.14-log' socket: '' port: 3306
The server will continue to write to the console any further diagnostic output it produces. You can open a new console window in which to run client programs.
If you omit the --console option, the server writes diagnostic output
to the error log in the data directory. The error log is the file with the
`.err' extension.
The accounts that are listed in the MySQL grant tables initially have no passwords. After starting the server, you should set up passwords for them using the instructions in section 2.4 Post-installation Setup and Testing.
The MySQL server can be started manually from the command line. This can be done on any version of Windows.
To start the mysqld server from the command line, you should
start a console window (a ``DOS'' window) and enter this command:
shell> C:\mysql\bin\mysqld
On non-NT versions of Windows, this will start mysqld in the
background. That is, after the server starts, you should see another
command prompt. If you start the server this way on Windows NT, 2000, or XP,
the server will run in the foreground and no command prompt will appear
until the server exits. Because of this, you should open another console
window to run client programs while the server is running.
You can stop the MySQL server by executing this command:
shell> C:\mysql\bin\mysqladmin -u root shutdown
This invokes the MySQL administrative utility mysqladmin to
connect to the server and tell it to shut down. The command connects
as root, which is the default administrative account in the
MySQL grant system. Please note that users in the MySQL grant system
are wholly independent from any login users under Windows.
If mysqld doesn't start, check the error log to see whether the
server wrote any messages there to indicate the cause of the problem.
The error log is located in the `C:\mysql\data' directory. It is
the file with a suffix of `.err'. You can also try to start the
server as mysqld --console; in this case, you may get some useful
information on the screen that may help solve the problem.
The last option is to start mysqld with
--standalone --debug.
In this case mysqld will write a log file
`C:\mysqld.trace' that should contain the reason why
mysqld doesn't start. See section D.1.2 Creating Trace Files.
Use mysqld --help to display all the options that
mysqld understands!
On the NT family (Windows NT, 2000, or XP), the recommended way to run MySQL
is to install it as a Windows service. Then Windows starts and stops the MySQL
server automatically when Windows starts and stops. A server installed as a
service can also be controlled from the command line using NET
commands, or with the graphical Services utility.
The Services utility (the Windows
Service Control Manager) can be found in the Windows
Control Panel (under Administrative Tools
on Windows 2000). It is advisable to close the Services utility
while performing server installation or removal operations from this command
line. This prevents some odd errors.
To get MySQL to work with TCP/IP on Windows NT 4, you must install service pack 3 (or newer)!
Before installing MySQL as a Windows service, you should first stop the current server if it is running by using the following command:
shell> C:\mysql\bin\mysqladmin -u root shutdown
This invokes the MySQL administrative utility mysqladmin to
connect to the server and tell it to shut down. The command connects
as root, which is the default administrative account in the
MySQL grant system. Please note that users in the MySQL grant system
are wholly independent from any login users under Windows.
Now install the server as a service:
shell> mysqld --install
If you have problems installing mysqld as a
service using just the server name, try installing it using its full pathname:
shell> C:\mysql\bin\mysqld --install
As of MySQL 4.0.2, you can specify a specific service name after the
--install option. As of MySQL 4.0.3, you can in addition specify a
--defaults-file option after the service name to indicate where the
server should obtain options when it starts. The rules that determine the
service name and option files the server uses are as follows:
MySQL and the server reads options from the [mysqld] group in
the standard option files.
--install option, the server ignores the [mysqld] option
group and instead reads options from the group that has the same name as the
service. The server reads options from the standard option files.
--defaults-file option after the service name,
the server ignores the standard option files and reads options only from the
[mysqld] group of the named file.
Note: Prior to MySQL 4.0.17, a server installed as a Windows service has problems starting if its pathname or the service name contains spaces. For this reason, avoid installing MySQL in a directory such as `C:\Program Files' or using a service name containing spaces.
In the usual case that you install the server with --install
but no service name, the server is installed with a service
name of MySQL.
As a more complex example, consider the following command (which should be entered on a single line):
shell> C:\mysql\bin\mysqld --install mysql
--defaults-file=C:\my-opts.cnf
Here, a service name is given after the --install option. If no
--defaults-file option had been given, this command would have the
effect of causing the server to read the [mysql] group from the
standard option files. (This would be a bad idea, because that option group
is for use by the mysql client program.) However, because the
--defaults-file option is present, the server reads options only from
the named file, and only from the [mysqld] option group.
You can also specify options as ``Start parameters'' in the
Windows Services utility before you start the MySQL service.
Once a MySQL server is installed as a service, Windows will start
the service automatically whenever Windows starts. The service also
can be started immediately from the Services utility, or by
using the command NET START MySQL. The NET command
is not case sensitive.
Please note that when run as a service, mysqld has no access
to a console window, so no messages can be seen there. If
mysqld doesn't start, check the error log to see whether the
server wrote any messages there to indicate the cause of the problem.
The error log is located in the `C:\mysql\data' directory. It
is the file with a suffix of `.err'.
When mysqld is running as a service, it can be stopped by
using the Services utility, the command NET STOP
MySQL, or the command mysqladmin shutdown. If the service
is running when Windows shuts down, Windows will stop the server
automatically.
From MySQL version 3.23.44, you have the choice of installing the
server as a Manual service if you don't wish the service to
be started automatically during the boot process. To do this, use
the --install-manual option rather than the --install
option:
shell> C:\mysql\bin\mysqld --install-manual
To remove a server that is installed as a service, first stop it if it is
running. Then use the --remove option to remove it:
shell> mysqld --remove
For MySQL versions older than 3.23.49, one problem with automatic
MySQL service shutdown is that Windows waited only for a few
seconds for the shutdown to complete, then killed the database
server process if the time limit was exceeded. This had the potential
to cause problems. (For example, the InnoDB storage engine
had to perform crash recovery at the next startup.) Starting from
MySQL version 3.23.49, Windows waits longer for the MySQL server
shutdown to complete. If you notice this still is not enough for
your installation, it is safest not to run the MySQL server as a
service. Instead, start it from the command-line prompt, and stop
it with mysqladmin shutdown.
This change to tell Windows to wait longer when stopping the MySQL server
works for Windows 2000 and XP. It does not work for Windows NT, where Windows
waits only 20 seconds for a service to shut down, and after that kills the
service process. You can increase this default by opening the Registry
Editor `\winnt\system32\regedt32.exe' and editing the value of
WaitToKillServiceTimeout at
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
in the Registry tree. Specify the new larger value in milliseconds.
For example, the value 120000 tells Windows NT to wait up to 120 seconds.
If you don't want to start mysqld as a service, you can
start it from the command line the same way as for versions of
Windows that are not based on NT. For instructions, see section 2.2.1.6 Starting MySQL from the Windows Command Line.
You can test whether the MySQL server is working by executing any of the following commands:
C:\> C:\mysql\bin\mysqlshow C:\> C:\mysql\bin\mysqlshow -u root mysql C:\> C:\mysql\bin\mysqladmin version status proc C:\> C:\mysql\bin\mysql test
If mysqld is slow to respond to TCP/IP connections from client programs
on Windows 9x/Me, there is
probably a problem with your DNS. In this case, start mysqld with the
--skip-name-resolve option and use only localhost and IP
numbers in the Host column of the MySQL grant tables.
You can force a MySQL client to use a named pipe connection rather than TCP/IP
by specifying the
--pipe option or by specifying . (period) as the host
name. Use the --socket option to specify the name of the
pipe. In MySQL 4.1, you should use the --protocol=PIPE
option.
There are two versions of the MySQL command-line tool:
| Binary | Description |
mysql | Compiled on native Windows, offering limited text editing capabilities. |
mysqlc | Compiled with the Cygnus GNU compiler and libraries, which offers readline editing.
|
If you want to use mysqlc, you must have a copy of the
`cygwinb19.dll' library installed somewhere that mysqlc
can find it. Current distributions of MySQL include this library
in the same directory as mysqlc (the `bin' directory
under the base directory of your MySQL installation). If your
distribution does not have the cygwinb19.dll library in the
`bin' directory, look for it in the lib directory and
copy it to your Windows system directory
(`\Windows\system' or similar place).
MySQL for Windows has by now proven itself to be very stable. The Windows version of MySQL has the same features as the corresponding Unix version, with the following exceptions:
mysqld for an extended time on Windows 95 if your server handles
many connections! Other versions of Windows don't suffer from this bug.
pread() and pwrite() calls to be
able to mix INSERT and SELECT. Currently we use mutexes
to emulate pread()/pwrite(). We will, in the long run,
replace the file level interface with a virtual interface so that we can
use the readfile()/writefile() interface on NT/2000/XP to
get more speed.
The current implementation limits the number of open files MySQL
can use to 1024, which means that you will not be able to run as many
concurrent threads on NT/2000/XP as on Unix.
mysqladmin kill will not work on a sleeping connection.
mysqladmin shutdown can't abort as long as there are sleeping
connections.
DROP DATABASE
mysqladmin shutdown.
LOAD
DATA INFILE or SELECT ... INTO OUTFILE,
use Unix style filenames with `/' characters:
mysql> LOAD DATA INFILE 'C:/tmp/skr.txt' INTO TABLE skr; mysql> SELECT * INTO OUTFILE 'C:/tmp/skr.txt' FROM skr;Alternatively, you must double the `\' character:
mysql> LOAD DATA INFILE 'C:\\tmp\\skr.txt' INTO TABLE skr; mysql> SELECT * INTO OUTFILE 'C:\\tmp\\skr.txt' FROM skr;
^Z / CHAR(24), Windows will think it
has encountered end-of-file and abort the program.
This is mainly a problem when you try to apply a binary log as follows:
C:\> mysqlbinlog binary-log-name | mysql --user=rootIf you get a problem applying the log and suspect it's because of an
^Z
/ CHAR(24) character you can use the following workaround:
C:\> mysqlbinlog binary-log-file --result-file=/tmp/bin.sql C:\> mysql --user=root --execute "source /tmp/bin.sql"The latter command also can be used to reliably read in any SQL file that may contain binary data.
Can't open named pipe error
error 2017: can't open named pipe to host: . pipe...This happens because the release version of MySQL uses named pipes on NT by default. You can avoid this error by using the
--host=localhost
option to the new MySQL clients or create an option file
`C:\my.cnf' that contains the following information:
[client] host = localhostStarting from 3.23.50, named pipes are enabled only if
mysqld-nt or
mysqld-max-nt is started with --enable-named-pipe.
Access denied for user error
Access denied
for user: 'some-user@unknown' to database 'mysql', this means
that MySQL can't resolve your hostname properly.
To fix this, you should create a file `\windows\hosts' with the
following information:
127.0.0.1 localhost
ALTER TABLE
ALTER TABLE statement, the table is locked
from being used by other threads. This has to do with the fact that on Windows,
you can't delete a file that is in use by another threads. In the future,
we may find some way to work around this problem.
DROP TABLE
DROP TABLE on a table that is in use by a MERGE table will
not work on Windows because the MERGE handler does the table mapping
hidden from the upper layer of MySQL. Because Windows doesn't allow you
to drop files that are open, you first must flush all MERGE
tables (with FLUSH TABLES) or drop the MERGE table before
dropping the table. We will fix this at the same time we introduce
views.
DATA DIRECTORY and INDEX DIRECTORY
DATA DIRECTORY and INDEX DIRECTORY options for
CREATE TABLE are ignored on Windows, because Windows doesn't support
symbolic links. These options also are ignored on systems that have a
non-functional realpath() call.
Here are some open issues for anyone who might want to help us improve MySQL on Windows:
mysqld from the task manager.
For the moment, you must use mysqladmin shutdown.
readline to Windows for use in the mysql command-line tool.
mysql,
mysqlshow, mysqladmin, and mysqldump) would be nice.
mysqladmin kill on Windows.
The recommended way to install MySQL on Linux is by using the RPM
packages. The MySQL RPMs are currently built on a SuSE Linux 7.3
system but should work on most versions of Linux that support rpm
and use glibc.
Note: RPM distributions of MySQL often are provided by other vendors. Be aware that they may differ in features and capabilities from those built by MySQL AB, and that the instructions in this manual do not necessarily apply to installing them. The vendor's instructions should be consulted instead.
If you have problems with an RPM file (for example, if you receive the error
``Sorry, the host 'xxxx' could not be looked up''), see
section 2.6.1.2 Linux Binary Distribution Notes.
In most cases, you only need to install the MySQL-server and
MySQL-client packages to get a functional MySQL installation. The
other packages are not required for a standard installation.
If you want to run a MySQL-Max server that has additional capabilities,
you should install the MySQL-Max RPM. However, you should do so only
after installing the MySQL-server RPM.
See section 5.1.2 The mysqld-max Extended MySQL Server.
If you get a dependency failure when trying to install the MySQL 4.0
packages (for example, ``error: removing these packages would break dependencies:
libmysqlclient.so.10 is needed by ...''), you should also install
the package MySQL-shared-compat, which includes both the
shared libraries for backward compatibility (libmysqlclient.so.12
for MySQL 4.0 and libmysqlclient.so.10 for MySQL 3.23).
Many Linux distributions still ship with MySQL 3.23 and they usually link
applications dynamically to save disk space. If these shared libraries are
in a separate package (for example, MySQL-shared), it is
sufficient to simply leave this package installed and just upgrade
the MySQL server and client packages (which are statically linked
and do not depend on the shared libraries). For distributions that
include the shared libraries in the same package as the MySQL server
(for example, Red Hat Linux), you could either install our 3.23
MySQL-shared RPM, or use the MySQL-shared-compat package instead.
The following RPM packages are available:
MySQL-server-VERSION.i386.rpm
The MySQL server. You will need this unless you only want to
connect to a MySQL server running on another machine. Please note:
Server RPM files were called MySQL-VERSION.i386.rpm before
MySQL 4.0.10. That is, they did not have -server in the name.
MySQL-Max-VERSION.i386.rpm
The MySQL-Max server. This server has additional capabilities that the
one provided in the MySQL-server RPM does not. You must install the
MySQL-server RPM first, because the MySQL-Max RPM depends on it.
MySQL-client-VERSION.i386.rpm
The standard MySQL client programs. You probably always want to
install this package.
MySQL-bench-VERSION.i386.rpm
Tests and benchmarks. Requires Perl and the DBD::mysql module.
MySQL-devel-VERSION.i386.rpm
The libraries and include files that are needed if you want to compile other
MySQL clients, such as the Perl modules.
MySQL-shared-VERSION.i386.rpm
This package contains the shared libraries (libmysqlclient.so*)
that certain languages and applications need to dynamically load and
use MySQL.
MySQL-shared-compat-VERSION.i386.rpm
This package includes the shared libraries for both MySQL 3.23 and
MySQL 4.0. Install this package instead of MySQL-shared, if you
have applications installed that are dynamically linked against MySQL
3.23 but you want to upgrade to MySQL 4.0 without breaking the library
dependencies. This package is available since MySQL 4.0.13.
MySQL-embedded-VERSION.i386.rpm
The embedded MySQL server library (from MySQL 4.0).
MySQL-VERSION.src.rpm
This contains the source code for all of the previous packages. It can also
be used to rebuild the RPMs on other architectures (for example, Alpha or SPARC).
To see all files in an RPM package (for example, a MySQL-server
RPM), run:
shell> rpm -qpl MySQL-server-VERSION.i386.rpm
To perform a standard minimal installation, run:
shell> rpm -i MySQL-server-VERSION.i386.rpm shell> rpm -i MySQL-client-VERSION.i386.rpm
To install just the client package, run:
shell> rpm -i MySQL-client-VERSION.i386.rpm
RPM provides a feature to verify the integrity and authenticity of packages
before installing them. If you would like to learn more about this feature
please see section 2.1.4 Verifying Package Integrity Using MD5 Checksums or GnuPG.
The server RPM places data under the `/var/lib/mysql' directory. The RPM also creates the appropriate entries in `/etc/init.d/' to start the server automatically at boot time. (This means that if you have performed a previous installation and have made changes to its startup script, you may want to make a copy of the script so you don't lose it when you install a newer RPM.) See section 2.4.2.2 Starting and Stopping MySQL Automatically for more information on how MySQL can be started automatically on system startup.
If you want to install the MySQL RPM on older Linux distributions that do not support initialization scripts in `/etc/init.d' (directly or via a symlink), you should create a symbolic link that points to the location where your initialization scripts actually are installed. For example, if that location is `/etc/rc.d/init.d', use these commands before installing the RPM to create `/etc/init.d' as a symbolic link that points there:
shell> cd /etc; ln -s rc.d/init.d .
However, all current major Linux distributions should already support the new directory layout that uses `/etc/init.d', because it is required for LSB (Linux Standard Base) compliance.
If the RPM files that you install include MySQL-server, the
mysqld server should be up and running after installation.
You should now be able to start using MySQL.
See section 2.4 Post-installation Setup and Testing.
If something goes wrong, you can find more information in the binary installation chapter. See section 2.2.5 Installing MySQL on Other Unix-like Systems.
Beginning with MySQL 4.0.11, you can install MySQL on Mac OS X 10.2
(``Jaguar'') using a Mac OS X binary package in PKG format instead of the
binary tarball distribution. Please note that older versions of Mac OS X
(for example, 10.1.x) are not supported by this package.
The package is located inside a disk image (.dmg) file, that you
first need to mount by double-clicking its icon in the Finder. It should
then mount the image and display its contents.
Note: Before proceeding with the installation, be sure to
shut down all running MySQL server instances by either
using the MySQL Manager Application (on Mac OS X Server) or via
mysqladmin shutdown on the command line.
To actually install the MySQL PKG file, double click on the package icon. This launches the Mac OS X Package Installer, which will guide you through the installation of MySQL.
Due to a bug in the Mac OS X package installer, you may sometimes see the
error message You cannot install this software on this disk. (null)
in the destination disk selection dialogue. If this error occurs, simply
click the Go Back button once to return to the previous screen. Then
click Continue to advance to the destination disk selection again,
and you should be able to choose the destination disk correctly. We have
reported this bug to Apple and they are investigating this problem.
The Mac OS X PKG of MySQL will install itself into
`/usr/local/mysql-<version>' and will also install a symbolic link
`/usr/local/mysql', pointing to the new location. If a directory named
`/usr/local/mysql' already exists, it will be renamed to
`/usr/local/mysql.bak' first. Additionally, it will install the
grant tables in the mysql database by executing mysql_install_db
after the installation.
The installation layout is similar to the one of the binary distribution; all MySQL binaries are located in the directory `/usr/local/mysql/bin'. The MySQL socket file is created as `/tmp/mysql.sock' by default. See section 2.1.8 Installation Layouts.
MySQL installation requires a Mac OS X user account named mysql
(a user account with this name should exist by default
on Mac OS X 10.2 and up).
If you are running Mac OS X Server, you already have a version of MySQL installed. The versions of MySQL that ship with Mac OS X Server versions are shown in the following table:
| Mac OS X Server Version | MySQL Version |
| 10.2-10.2.2 | 3.23.51 |
| 10.2.3-10.2.6 | 3.23.53 |
| 10.3 | 4.0.14 |
| 10.3.2 | 4.0.16 |
This manual section covers the installation of the official MySQL Mac OS X PKG only. Make sure to read Apple's help about installing MySQL (Run the ``Help View'' application, select ``Mac OS X Server'' help, and do a search for ``MySQL'' and read the item entitled ``Installing MySQL'').
For pre-installed versions of MySQL on Mac OS X Server, note especially that
you should start mysqld with safe_mysqld instead of
mysqld_safe if MySQL is older than version 4.0.
If you previously used Marc Liyanage's MySQL packages for Mac OS X from http://www.entropy.ch, you can simply follow the update instructions for packages using the binary installation layout as given on his pages.
If you are upgrading from Marc's 3.23.xx versions or from the Mac OS X Server version of MySQL to the official MySQL PKG, you also need to convert the existing MySQL privilege tables to the current format, because some new security privileges have been added. See section 2.5.8 Upgrading the Grant Tables.
If you would like to automatically start up MySQL during system startup, you
also need to install the MySQL Startup Item. Starting with MySQL 4.0.15, it
is part of the Mac OS X installation disk images as a separate installation
package. Simply double-click the MySQLStartupItem.pkg icon and follow
the instructions to install it.
Note that the Startup Item need be installed only once! There is no need to install it each time you upgrade the MySQL package later.
The Startup Item will be installed into `/Library/StartupItems/MySQL'.
It adds a variable MYSQLCOM=-YES- to the system configuration file
`/etc/hostconfig'. If you would like to disable the automatic startup
of MySQL, simply change this variable to MYSQLCOM=-NO-.
On Mac OS X Server, the default MySQL installation uses the variable
MYSQL in `/etc/hostconfig'. The MySQL AB Startup Item installer
disables this variable by setting it to MYSQL=-NO-. This avoids
boot time conflicts with the MYSQLCOM variable used by the MySQL AB
Startup Item. However, it does not shut down an already running MySQL server.
After the installation, you can start up MySQL by running the following commands in a terminal window. Please note that you must have administrator privileges to perform this task.
If you have installed the Startup Item:
shell> sudo /Library/StartupItems/MySQL/MySQL start (Enter your password, if necessary) (Press Control-D or enter "exit" to exit the shell)
If you don't use the Startup Item, enter the following command sequence:
shell> cd /usr/local/mysql shell> sudo ./bin/mysqld_safe (Enter your password, if necessary) (Press Control-Z) shell> bg (Press Control-D or enter "exit" to exit the shell)
You should now be able to connect to the MySQL server, for example, by running `/usr/local/mysql/bin/mysql'.
If you are installing MySQL for the first time, please remember to set a
password for the MySQL root user!
This is done with the following two commands:
/usr/local/mysql/bin/mysqladmin -u root password "newpwd" /usr/local/mysql/bin/mysqladmin -u root -h `hostname` password "newpwd"
Please make sure that the hostname command in the second line
is enclosed by backtick characters (`), so the shell can
replace it with the output of the command (which is the hostname of your
system)!
You might want to also add aliases to your shell's resource file to
access mysql and mysqladmin from the command line. The syntax
for tcsh is:
alias mysql /usr/local/mysql/bin/mysql alias mysqladmin /usr/local/mysql/bin/mysqladmin
For bash, use:
alias mysql=/usr/local/mysql/bin/mysql alias mysqladmin=/usr/local/mysql/bin/mysqladmin
Even better,
add /usr/local/mysql/bin to
your PATH environment variable. For example, add the following
line to your `$HOME/.tcshrc' file if your shell is tcsh:
setenv PATH ${PATH}:/usr/local/mysql/bin
If no `.tcshrc' file exists in your home directory, create it with a text editor.
If you are upgrading an existing installation, please note that installing a new MySQL PKG does not remove the directory of an older installation. Unfortunately, the Mac OS X Installer does not yet offer the functionality required to properly upgrade previously installed packages.
To use your existing databases with the new installation, you'll need to copy the contents of the old data directory to the new data directory. Make sure neither the old server nor the new one is running when you do this. After you have copied over the MySQL database files from the previous installation and have successfully started the new server, you should consider removing the old installation files to save disk space. Additionally, you should also remove older versions of the Package Receipt directories located in `/Library/Receipts/mysql-<version>.pkg'.
Porting MySQL to NetWare was an effort spearheaded by Novell. Novell customers will be pleased to note that NetWare 6.5 will ship with bundled MySQL binaries, complete with an automatic commercial use license for all servers running that version of NetWare.
As of version 4.0.11, the MySQL server is available for Novell NetWare in
binary package form. MySQL for NetWare is compiled using a combination
of Metrowerks CodeWarrior for NetWare and special cross-compilation
versions of the GNU autotools.
In order to host MySQL, the NetWare server must meet these requirements:
The binary package for NetWare can be obtained at http://www.mysql.com/downloads/.
To install MySQL for NetWare, use the following procedure:
SERVER: mysqladmin -u root shutdown
SERVER: SEARCH ADD SYS:MYSQL\BIN
mysql_install_db at the server console.
mysqld_safe at the server console.
autoexec.ncf. For example, if your MySQL installation is in
`SYS:MYSQL' and you want MySQL to start automatically, you could
add these lines:
#Starts the MySQL 4.0.x database server SEARCH ADD SYS:MYSQL\BIN MYSQLD_SAFEIf you are running MySQL on NetWare 6.0, we strongly suggest that you use the
--skip-external-locking option on the command line:
#Starts the MySQL 4.0.x database server SEARCH ADD SYS:MYSQL\BIN MYSQLD_SAFE --skip-external-lockingIt will also be neccesary to use
CHECK TABLE and REPAIR
TABLE instead of myisamchk, because myisamchk makes use
of external locking. External locking is known to have problems on
NetWare 6.0; the problem has been eliminated in NetWare 6.5.
mysqld_safe on NetWare provides a screen presence. When you unload
(shut down) the mysqld_safe NLM, the screen does not by default go
away. Instead, it prompts for user input:
*<NLM has terminated; Press any key to close the screen>*If you want NetWare to close the screen automatically instead, use the
--autoclose option to mysqld_safe. For example:
#Starts the MySQL 4.0.x database server SEARCH ADD SYS:MYSQL\BIN MYSQLD_SAFE --autocloseThe behavior of
mysqld_safe on NetWare is described further in
section 5.1.3 The mysqld_safe Server Startup Script.
If there was an existing installation of MySQL on the server, be sure
to check for existing MySQL startup commands in autoexec.ncf,
and edit or delete them as necessary.
This section covers the installation of MySQL binary distributions that are
provided for various platforms in the form of compressed tar files
(files with a .tar.gz extension). See section 2.1.2.5 MySQL Binaries Compiled by MySQL AB for a
detailed list.
In addition to these generic packages, we also offer binaries in platform-specific package formats for selected platforms. See section 2.2 Standard MySQL Installation Using a Binary Distribution for more information on how to install these.
You need the following tools to install a MySQL tar file binary
distribution:
gunzip to uncompress the distribution.
tar to unpack the distribution. GNU tar is known
to work. Some operating systems come with a pre-installed version of
tar that is known to have problems. For example, Mac OS X tar
and Sun tar are known to have problems with long filenames. On Mac
OS X, you can use the pre-installed gnutar program. On other systems
with a deficient tar, you should install GNU tar first.
If you run into problems, please always use mysqlbug when
posting questions to a MySQL mailing list. Even if the problem
isn't a bug, mysqlbug gathers system information that will help others
solve your problem. By not using mysqlbug, you lessen the likelihood
of getting a solution to your problem. You will find mysqlbug in the
`bin' directory after you unpack the distribution. See section 1.7.1.3 How to Report Bugs or Problems.
The basic commands you must execute to install and use a MySQL binary distribution are:
shell> groupadd mysql shell> useradd -g mysql mysql shell> cd /usr/local shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf - shell> ln -s full-path-to-mysql-VERSION-OS mysql shell> cd mysql shell> scripts/mysql_install_db --user=mysql shell> chown -R root . shell> chown -R mysql data shell> chgrp -R mysql . shell> bin/mysqld_safe --user=mysql &
For versions of MySQL older than 4.0, substitute bin/safe_mysqld
for bin/mysqld_safe in the final command.
A more detailed description follows.
To install a binary distribution, follow these steps, then proceed to section 2.4 Post-installation Setup and Testing, for post-installation setup and testing:
mysqld to run as:
shell> groupadd mysql shell> useradd -g mysql mysqlThese commands add the
mysql group and the mysql user. The
syntax for useradd and groupadd may differ slightly on different
versions of Unix. They may also be called adduser and addgroup.
You may wish to call the user and group something else instead of mysql.
root.)
tar file binary distributions
have names like `mysql-VERSION-OS.tar.gz', where
VERSION is a number (for example, 4.0.17), and OS
indicates the type of operating system for which the distribution is intended
(for example, pc-linux-gnu-i586).
For a given release, binary distributions for all platforms
are built from the same MySQL source distribution.
shell> cd /usr/local
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf - shell> ln -s full-path-to-mysql-VERSION-OS mysqlThe
tar command creates a directory named `mysql-VERSION-OS'. The
ln command makes a symbolic link to that directory. This lets you refer
more easily to the installation directory as `/usr/local/mysql'.
With GNU tar, no separate invocation of gunzip is necessary.
You can replace the first line with the following
alternative command to uncompress and extract the distribution:
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
shell> cd mysqlYou will find several files and subdirectories in the
mysql directory.
The most important for installation purposes are the `bin' and
`scripts' subdirectories.
PATH environment variable so that your shell finds the MySQL
programs properly. See section E Environment Variables.
mysql_install_db script used to initialize
the mysql database containing the grant tables that store the server
access permissions.
shell> scripts/mysql_install_db --user=mysqlIf you run the command as
root, you should use the --user
option as shown. If you run the command as mysql, you can omit it.
Note that for MySQL versions older than Version 3.22.10,
mysql_install_db left the server running after creating the grant
tables. This is no longer true; you will need to restart the server after
performing the remaining steps in this procedure.
root and ownership of the data
directory to the user that you will run mysqld as. Assuming that you
are located in the installation directory (`/usr/local/mysql'), the
commands look like this:
shell> chown -R root . shell> chown -R mysql data shell> chgrp -R mysql .The first command changes the
owner attribute of the files to the
root user. The second changes the owner attribute of the
data directory to the mysql user. The third changes the
group attribute to the mysql group.
support-files/mysql.server to the location where
your system has its startup files. More information can be found in the
support-files/mysql.server script itself and in
section 2.4.2.2 Starting and Stopping MySQL Automatically.
bin/mysql_setpermission script if
you install the DBI and DBD::mysql Perl modules.
For instructions, see section 2.7 Perl Installation Notes.
mysqlaccess and have the MySQL
distribution in some non-standard place, you must change the location where
mysqlaccess expects to find the mysql client. Edit the
`bin/mysqlaccess' script at approximately line 18. Search for a line
that looks like this:
$MYSQL = '/usr/local/bin/mysql'; # path to mysql executableChange the path to reflect the location where
mysql actually is
stored on your system. If you do not do this, you will get a Broken
pipe error when you run mysqlaccess.
After everything has been unpacked and installed, you should test your distribution.
You can start the MySQL server with the following command:
shell> bin/mysqld_safe --user=mysql &
For versions of MySQL older than 4.0, substitute bin/safe_mysqld
for bin/mysqld_safe in the command.
Now proceed to section 2.4 Post-installation Setup and Testing.
More information about mysqld_safe is given in
section 5.1.3 The mysqld_safe Server Startup Script.
Before you proceed with the source installation, check first to see whether our binary is available for your platform and whether it will work for you. We put a lot of effort into making sure that our binaries are built with the best possible options.
You need the following tools to build and install MySQL from source:
gunzip to uncompress the distribution.
tar to unpack the distribution. GNU tar is
known to work. Some tar implementations that come pre-installed
with the operating system (for example, Sun tar) is known to have
problems with long file names). In that case, you should install
GNU tar first.
gcc 2.95.2 or later, egcs 1.0.2 or later or egcs 2.91.66, SGI C++, and SunPro C++ are some of the
compilers that are known to work. libg++ is not needed when
using gcc. gcc 2.7.x has a bug that makes it impossible
to compile some perfectly legal C++ files, such as
`sql/sql_base.cc'. If you only have gcc 2.7.x, you must
upgrade your gcc to be able to compile MySQL. gcc
2.8.1 is also known to have problems on some platforms, so it should be
avoided if a new compiler exists for the platform.
gcc 2.95.2 or later is recommended when compiling MySQL
Version 3.23.x.
make program. GNU make is always recommended and is
sometimes required. If you have problems, we recommend trying GNU
make 3.75 or newer.
If you are using a recent version of gcc, recent enough to understand the
-fno-exceptions option, it is very important that you use
it. Otherwise, you may compile a binary that crashes randomly. We also
recommend that you use -felide-constructors and -fno-rtti along
with -fno-exceptions. When in doubt, do the following:
CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors \
-fno-exceptions -fno-rtti" ./configure \
--prefix=/usr/local/mysql --enable-assembler \
--with-mysqld-ldflags=-all-static
On most systems this will give you a fast and stable binary.
If you run into problems, please always use mysqlbug when
posting questions to a MySQL mailing list. Even if the problem
isn't a bug, mysqlbug gathers system information that will help others
solve your problem. By not using mysqlbug, you lessen the likelihood
of getting a solution to your problem. You will find mysqlbug in the
`scripts' directory after you unpack the distribution.
See section 1.7.1.3 How to Report Bugs or Problems.
The basic commands you must execute to install a MySQL source distribution are:
shell> groupadd mysql shell> useradd -g mysql mysql shell> gunzip < mysql-VERSION.tar.gz | tar -xvf - shell> cd mysql-VERSION shell> ./configure --prefix=/usr/local/mysql shell> make shell> make install shell> cp support-files/my-medium.cnf /etc/my.cnf shell> cd /usr/local/mysql shell> bin/mysql_install_db shell> chown -R root . shell> chown -R mysql var shell> chgrp -R mysql . shell> bin/mysqld_safe --user