Search the MySQL manual:

2.1.2 Installing MySQL on Linux

The recommended way to install MySQL on Linux is by using the RPM packages. The MySQL RPMs are currently built on a SuSE Linux 7.3 system but should work on most versions of Linux that support rpm and use glibc.

If you have problems with an RPM file (for example, if you receive the error ``Sorry, the host 'xxxx' could not be looked up''), see section 2.6.2.1 Linux Notes for Binary Distributions.

In most cases, you only need to install the MySQL-server and MySQL-client packages to get a functional MySQL installation. The other packages are not required for a standard installation. If you want to run a MySQL Max server that has additional capabilities, you should install the MySQL-Max RPM after installing the MySQL-server RPM. See section 4.7.5 mysqld-max, An Extended mysqld Server.

If you get a dependency failure when trying to install the MySQL 4.0 packages (for example, ``error: removing these packages would break dependencies: libmysqlclient.so.10 is needed by ...''), you should also install the package MySQL-shared-compat, which includes both the shared libraries for backward compatibility (libmysqlclient.so.12 for MySQL 4.0 and libmysqlclient.so.10 for MySQL 3.23).

Many Linux distributions still ship with MySQL 3.23 and they usually link applications dynamically to save disk space. If these shared libraries are in a separate package (for example, MySQL-shared), it is sufficient to simply leave this package installed and just upgrade the MySQL server and client packages (which are statically linked and do not depend on the shared libraries). For distributions that include the shared libraries in the same package as the MySQL server (for example, Red Hat Linux), you could either install our 3.23 MySQL-shared RPM, or use the MySQL-shared-compat package instead.

The following RPM packages are available:

To see all files in an RPM package (for example, a MySQL-server RPM), run:

shell> rpm -qpl MySQL-server-VERSION.i386.rpm

To perform a standard minimal installation, run:

shell> rpm -i MySQL-server-VERSION.i386.rpm MySQL-client-VERSION.i386.rpm

To install just the client package, run:

shell> rpm -i MySQL-client-VERSION.i386.rpm

The server RPM places data under the `/var/lib/mysql' directory. The RPM also creates the appropriate entries in `/etc/init.d/' to start the server automatically at boot time. (This means that if you have performed a previous installation and have made changes to its startup script, you may want to make a copy of the script so you don't lose it when you install a newer RPM.) See section 2.4.3 Starting and Stopping MySQL Automatically for more information on how MySQL can be started automatically on system startup.

If you want to install the MySQL RPM on older Linux distributions that do not support initialisation scripts in `/etc/init.d' (directly or via a symlink), you should create a symbolic link that points to the location where your initialisation scripts actually are installed. For example, if that location is `/etc/rc.d/init.d', use these commands before installing the RPM to create `/etc/init.d' as a symbolic link that points there:

shell> cd /etc ; ln -s rc.d/init.d .

However, all current major Linux distributions should already support the new directory layout that uses `/etc/init.d', because it is required for LSB (Linux Standard Base) compliance.

If the RPM files that you install include MySQL-server, the mysqld daemon should be up and running after installation. You should now be able to start using MySQL. See section 2.4 Post-installation Setup and Testing.

If something goes wrong, you can find more information in the binary installation chapter. See section 2.2.11 Installing a MySQL Binary Distribution.

User Comments

Add your own comment.