Unix Postinstallation Procedures
128
1. Change location into the top-level directory of your MySQL installation, represented here by
BASEDIR
:
shell>
cd BASEDIR
BASEDIR
is the installation directory for your MySQL instance. It is likely to be something like
/
usr/local/mysql
or
/usr/local
. The following steps assume that you have changed location
to this directory.
You will find several files and subdirectories in the
BASEDIR
directory. The most important for
installation purposes are the
bin
and
scripts
subdirectories:
• The
bin
directory contains client programs and the server. You should add the full path name
of this directory to your
PATH
environment variable so that your shell finds the MySQL programs
properly. See
Section 2.21, “Environment Variables”
.
For some distribution types,
mysqld
is in the
libexec
directory.
• The
scripts
directory contains the
mysql_install_db
script used to initialize the
mysql
database containing the grant tables that store the server access permissions.
For some distribution types,
mysql_install_db
is in the
bin
directory.
2. If necessary, ensure that the distribution contents are accessible to
mysql
. If you unpacked the
distribution as
mysql
, no further action is required. If you unpacked the distribution as
root
,
its contents will be owned by
root
. Change its ownership to
mysql
by executing the following
commands as
root
in the installation directory:
shell>
chown -R mysql .
shell>
chgrp -R mysql .
The first command changes the owner attribute of the files to the
mysql
user. The second changes
the group attribute to the
mysql
group.
3. If necessary, run the
mysql_install_db
program to set up the initial MySQL grant tables
containing the privileges that determine how users are permitted to connect to the server. You will
need to do this if you used a distribution type for which the installation procedure does not run the
program for you.
Typically,
mysql_install_db
needs to be run only the first time you install MySQL, so you can
skip this step if you are upgrading an existing installation, However,
mysql_install_db
does not
overwrite any existing privilege tables, so it should be safe to run in any circumstances.
The exact location of
mysql_install_db
will depends on the layout for your given installation.
To initialize the grant tables, use one of the following commands, depending on whether
mysql_install_db
is located in the
bin
or
scripts
directory:
shell>
bin/mysql_install_db --user=mysql
shell>
scripts/mysql_install_db --user=mysql
It might be necessary to specify other options such as
--basedir
[258]
or
--datadir
[258]
if
mysql_install_db
does not identify the correct locations for the installation directory or data
directory. For example:
shell>
bin/mysql_install_db --user=mysql \
--basedir=/opt/mysql/mysql \
--datadir=/opt/mysql/mysql/data
The
mysql_install_db
script creates the server's data directory with
mysql
as the owner.
Under the data directory, it creates directories for the
mysql
database that holds the grant tables
and the
test
database that you can use to test MySQL. The script also creates privilege table
entries for
root
and anonymous-user accounts. The accounts have no passwords initially.
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...