This version of is deprecated.
If you are not redirected to the new web site in 3 seconds, please click on the following link


Linux - Step by Step Install of mySQL
by Jason Lam
March 02, 2003

A step by step installation guide on how to install mySQL on Linux box. It is assumed you know what mySQL is and how to use it. For this guide I'm using Red Hat 7.3 and tarball version mysql-3.23.55.tar.gz

Visit the mySQL site and download the latest source version

Once you have downloaded and decompressed the files, configure the installation directory. Go to the root where you have uninstall the files and type the following:

./configure --prefix=/usr/local/mysql <enter>

This will set the installation to install in the /usr/local/mysql directory. If you like you can change this setting; however, the rest of this guide will assume this is where you are installing mysql.

Build and Install mySQL
Now type :
make <enter>

This process may take few minutes. After type
make install <enter>

This will definitely take a few minutes. After you should see bunch of installed files in /usr/local/mysql

Initialize mySQL
cd /scripts <enter>
./mysql_install_db <enter>

Configure Password
cd /usr/local/mysql <enter>
./safe_mysqld& <enter>
./mysqladmin -uroot -p[your-password-goes-here] <enter>

Add mySQL to Linux Start and Stop Run Levels
cp support-files/mysql.server /etc/rc.d/init.d/mysql <enter>
chmod +x /etc/rc.d/init.d/mysql <enter>
cd /etc/rc.d/rc3.d <enter>
ln -s ../init.d/mysql S85mysql <enter>
cd /etc/rc.d/rc5.d <enter>
ln -s ../init.d/mysql S85mysql <enter>

cd /etc/rc.d/rc0.d <enter>
ln -s ../init.d/mysql K85mysql <enter>
cd /etc/rc.d/rc6.d <enter>
ln -s ../init.d/mysql K85mysql <enter>

Reboot your system and test if mysql works.

cd /usr/local/mysql
bin/mysqladmin -uroot -p[your-password-goes-here] ping

You should see the following response mysqld is alive

You are done, you might want to add mysql bin directory to your PATH.


| Home | Tutorials | Tips / Hints | Books | Links |
| Resume | Portfolio | Services | Contact |

The contents of this webpage are copyright © 2003 - 2006
Jason Lam All Rights Reserved