Installing MySQL on LinuxUnix


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.rpmThe MySQL server

  • MySQL-client-VERSION.i386.rpmThe 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 

By the Way

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.21-0.i386.rpm, and the client libraries RPM is called MySQL-client-4.0.21-0.i386.rpm.


Another painless (and very common) installation method is to install MySQL from a binary distribution. This method requires the gunzip and tar utilities, to uncompress and unpack the distribution, and also requires the ability to create groups and users on the system. The first series of commands in the binary distribution installation process has you adding a group and a user and unpacking the distribution, as follows:

By the Way

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.21-pclinux-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.



Sams Teach Yourself PHP MySQL and Apache All in One
Sams Teach Yourself PHP, MySQL and Apache All in One (4th Edition)
ISBN: 067232976X
EAN: 2147483647
Year: 2003
Pages: 333
Authors: Julie Meloni

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net