Create a
mysql
User and Group
108
Note
This procedure assumes that you have
root
(administrator) access to your
system. Alternatively, you can prefix each command using the
sudo
(Linux) or
pfexec
(OpenSolaris) command.
The procedure does not set up any passwords for MySQL accounts. After
following the procedure, proceed to
Section 2.18, “Postinstallation Setup and
Testing”
.
Create a
mysql
User and Group
If your system does not already have a user and group for
mysqld
to run as, you may need to create
one. The following commands add the
mysql
group and the
mysql
user. The syntax for
useradd
and
groupadd
may differ slightly on different versions of Unix, or they may have different names such as
adduser
and
addgroup
.
shell>
groupadd mysql
shell>
useradd -r -g mysql mysql
Note
Because the user is required only for ownership purposes, not login purposes,
the
useradd
command uses the
-r
option to create a user that does not have
login permissions to your server. Omit this option to permit logins for the user
(or if your
useradd
does not support the option).
You might want to call the user and group something else instead of
mysql
. If so, substitute the
appropriate name in the preceding commands and in the following steps.
Obtain and Unpack the Distribution
Pick the directory under which you want to unpack the distribution and change location into it. The
example here unpacks the distribution under
/usr/local
. The instructions, therefore, assume that
you have permission to create files and directories in
/usr/local
. If that directory is protected, you
must perform the installation as
root
.
shell>
cd /usr/local
Obtain a distribution file using the instructions in
Section 2.5, “How to Get MySQL”
. For a given release,
binary distributions for all platforms are built from the same MySQL source distribution.
Unpack the distribution, which creates the installation directory. Then create a symbolic link to that
directory.
tar
can uncompress and unpack the distribution if it has
z
option support:
shell>
tar zxvf /path/to/mysql-VERSION-OS.tar.gz
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 enables you to refer more easily to the installation directory as
/
usr/local/mysql
.
If your
tar
does not have
z
option support, use
gunzip
to unpack the distribution and
tar
to unpack
it. Replace the preceding
tar
command with the following alternative command to uncompress and
extract the distribution:
shell>
gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
Perform Postinstallation Setup
The remainder of the installation process involves setting up the configuration file, creating the core
databases, and starting the MySQL server. For instructions, see
Section 2.18, “Postinstallation Setup
and Testing”
.
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 ...