| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This section covers the installation of MySQL binary distributions that are
provided for various platforms in the form of tar files (files with a
.tar.gz extension).
See 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 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, Sun tar and
Mac OS X tar are known to have problems with long filenames. In such
cases, you should install GNU tar first. On Mac OS X, you can use
the pre-installed gnutar program.
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 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 2.4 Post-installation Setup and Testing, for post-installation setup and testing:
mysqld to run as:
shell> groupadd mysql shell> useradd -g mysql mysql |
These 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.)
MySQL 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 mysql |
The 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 mysql |
You 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 |
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
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 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 executable |
Change 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 mysqld_safe, and
2.4 Post-installation Setup and Testing.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |