The recommended way to install MySQL on an Intel Linux system is via RedHat Package Manager (RPM). Table 2-1 lists the files that comprise a full MySQL installation.
Filename |
Description |
MySQL server software | |
MySQL client software | |
MySQL tests and benchmarks; requires the Perl and msql-mysql RPMs | |
Libraries and include files for compiling other MySQL clients | |
MySQL client shared libraries |
The procedure for installing an RPM distribution is simple. First, obtain the RPMs you wish to install. At a minimum, you should install the server and client software. Second, use the rpm utility to install the packages.
For this example, we assume that all the RPM packages for Version 3.23.40 on an Intel Linux system will be installed. Also, assume the following RPM files have been downloaded to /tmp:
MySQL-3.23.40-1.i386.rpm
MySQL-client-3.23.40-1.i386.rpm
MySQL-devel-3.23.40-1.i386.rpm
MySQL-bench-3.23.40-1.i386.rpm
MySQL-shared-3.23.40-1.i386.rpm
Execute this sequence of commands to install them:
$rpm -i /tmp/MySQL-3.23.40-1.i386.rpm
$rpm -i /tmp/MySQL-client-3.23.40-1.i386.rpm
$rpm -i /tmp/MySQL-devel-3.23.40-1.i386.rpm
$rpm -i /tmp/MySQL-bench-3.23.40-1.i386.rpm
$rpm -i /tmp/MySQL-shared-3.23.40-1.i386.rpm
The RPM creates the appropriate entries in /etc/rc.d to automatically start and stop the server at system boot and shutdown. The RPM also starts the mysql server, so after the RPM install is complete, you are ready to start using MySQL.
The RPM distributions place the files in different locations from the tarball distributions. To examine an RPM to determine where the files were placed, use the RPM query option:
$ rpm -qpl MySQL-version.i386.rpm
If you wish to determine the location but have discarded the RPM files already, you can query the RPM database:
$ rpm -ql MySQL-version
Also note that the RPM places data in /var/lib/data instead of /usr/local/mysql/data.