Installing MySQL on Linux/Unix
The process of installing MySQL on Linux/Unix is straightforward, whether you use RPMs or install the binaries. For a minimal installation from RPMs, you will need two files:
- MySQL-server-VERSION.i386.rpm
The MySQL server - MySQL-client-VERSION.i386.rpm
The standard MySQL client libraries
To perform a minimal installation from RPMs, type the following at your prompt:
#> rpm -i MySQL-server-VERSION.i386.rpm MySQL-client-VERSION.i386.rpm
![]() | Replace VERSION in the filename with the actual version you downloaded. For example, the current MySQL 4.0 server RPM is called MySQL-server-4.0.15-0.i386.rpm, and the client libraries RPM is called MySQL-client-4.0.15-0.i386.rpm. |
![]() | Replace VERSION-OS in the filename with the actual version you downloaded. For example, the current MySQL 4.0 Linux/i386 binary is called mysql-max-4.0.15-pc-linux-i686.tar.gz. |
#> groupadd mysql
#> useradd -g mysql mysql
#> cd /usr/local
#> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf
Next, the instructions tell you to create a link with a shorter name:
#> ln -s mysql-VERSION-OS mysql
#> cd mysql
Once unpacked, the README and INSTALL files will walk you through the remainder of the installation process for the version of MySQL you've chosen. In general, the following series of commands will be used:
#> scripts/mysql_install_db
#> chown -R root /usr/local/mysql
#> chown -R mysql /usr/local/mysql/data
#> chgrp -R mysql /usr/local/mysql
#> chown -R root /usr/local/mysql/bin
You're now ready to start the MySQL server, so skip down to the section called "Basic Security Guidelines." If you had any issues with your installation, check the "Troubleshooting Your Installation" section.