The basic commands you must execute to install a MySQL source
distribution are (from an unpacked tar
file):
shell> configure
shell> make
shell> make install
shell> scripts/mysql_install_db
shell> /usr/local/mysql/bin/safe_mysqld &
If you start from a source RPM, then do the following.
shell> rpm --rebuild MySQL-VERSION.src.rpm
This will make a binary RPM that you can install.
You can add new users using the bin/mysql_setpermission
script if
you install the DBI
and Msql-Mysql-modules
Perl modules.
Here follows a more detailed description:
To install a source distribution, follow the steps below, then proceed
to 4.15 Paramètrage post-installation et tests, for post-installation initialization and testing.
-
Pick the directory under which you want to unpack the distribution, and move
into it.
-
Obtain a distribution file from one of the sites listed in
Getting MySQL.
MySQL source distributions are provided as compressed
tar
archives and have names like `mysql-VERSION.tar.gz', where
VERSION
is a number like 3.23.5-alpha.
-
Unpack the distribution into the current directory:
shell> gunzip < mysql-VERSION.tar.gz | tar xvf -
This command creates a directory named `mysql-VERSION'.
-
Change into the top-level directory of the unpacked distribution:
shell> cd mysql-VERSION
-
Configure the release and compile everything:
shell> ./configure --prefix=/usr/local/mysql
shell> make
When you run configure
, you might want to specify some options.
Run ./configure --help
for a list of options.
configure
options, discusses some of the
more useful options.
If configure
fails, and you are going to send mail to
lines from `config.log' that you think can help solve the problem. Also
include the last couple of lines of output from configure
if
configure
aborts. Post the bug report using the mysqlbug
script. 2.3 Comment rapporter des bugs et des problèmes.
If the compile fails, see 4.8 Problèmes de compilation?, for help with
a number of common problems.
-
Install everything:
shell> make install
You might need to run this command as root
.
-
Create the MySQL grant tables (necessary only if you haven't
installed MySQL before):
shell> scripts/mysql_install_db
Note that MySQL versions older than 3.22.10 started the
MySQL server when you run mysql_install_db
. This is no
longer true!
-
If you want to install support for the Perl
DBI
/DBD
interface,
see 4.10 Remarques sur l'installation Perl.
-
If you would like MySQL to start automatically when you boot your
machine, you can copy
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 4.15.3 Démarrer et arrête MySQL automatiquement.
After everything has been installed, you should initialize and test your
distribution.
You can start the MySQL server with the following command,
where BINDIR
is the directory in which safe_mysqld
is
installed (`/usr/local/bin' by default):
shell> BINDIR/safe_mysqld &
If that command fails immediately with mysqld daemon ended
then you can
find some information in the file
`mysql-data-directory/'hostname'.err'. The likely reason is that
you already have another mysqld
server running. 19.3 Faire tourner plusieurs serveurs MySQL sur la même machine.
4.15 Paramètrage post-installation et tests.