Databases Reference
In-Depth Information
If you have superuser privileges and want your MySQL installation to be system-wide,
it's best to install to a directory under the
/usr/local
directory—for example,
/usr/local/
mysql-5.0.22
. On the other hand, if you want to run a local server, you can have the
MySQL directory wherever you wish—for example, under your own home directory
at
~/mysql-5.0.22
.
To install MySQL to the directory
/usr/local/mysql-5.0.22
, we call the
configure
com-
mand with the target as follows:
$
./configure --prefix=/usr/local/mysql-5.0.22
If all is not well, you may see some error messages. Problems during configuration are
generally due to Linux programs and libraries missing from your system; read the error
messages carefully to identify the cause of the problem.
If the configuration is successful, you can use the
make
command to compile the files:
$
make
The compilation process may take a long time.
fact the GNU make program; if you run into problems when using
make
, it might not be GNU
make
, and the problem may be resolved by
using the
gmake
(GNU make) command instead.
When it's done, you need to install the files to the directory you specified earlier. If
you've chosen to install a local server, you can simply type:
$
make install
If—as in our example—you've specified a prefix path that you can't normally write to
as an ordinary user, you'll need to first log in as root:
$
su -
and then run
make
install
from the root prompt to copy the compiled files to the target
installation directory:
#
make install
If all goes well, the MySQL files will be installed in the correct directory. You'll often
find it helpful to create a link to refer to this directory easily. For example, for a system-
wide server, you can make the link
/usr/local/mysql
to point to the
/usr/local/
mysql-5.0.22
directory:
#
ln --symbolic /usr/local/mysql-5.0.22 /usr/local/mysql
Now you can simply refer to the MySQL directory as
/usr/local/mysql
. Similarly, if
you specified the path
/home/adam/mysql-5.0.22
for a local installation, you can make
the link
~/mysql
to point to the
~/mysql-5.0.22
directory: