RLROUSE Directory & Informational Resources
Home     Add URL     Edit Listing     Infoblog     Picture of the Day     Privacy Policy     Advertise     About us     Write for us     Contact us     Sitemap


mySQL Installation Guide

How to install mySQL, step-by-step

mySQL is the world's most popular database. It serves as the back-end database engine for numerous websites. This is a step-by-step guide to installing mySQL on a Linux server. This mySQL installation guide assumes that you know what mySQL is and how to use it.

mySQL installation notes:

  • For the sample mySQL installation in this guide, I'll be using Red Hat Linux 7.3 and tarball version mysql-3.23.55.tar.gz.
  • Throughout the mySQL installation guide, <enter> means press the Enter key on the keyboard.
Steps for installing mySQL:
  1. Download the mySQL source files from the mySQL website.
  2. Once you have downloaded the mySQL source files and decompressed them, configure the installation directory.

    Navigate to the root directory and type the following:

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

    This will cause mySQL to be installed in this directory:


    You can change the mySQL installation directory if you wish, but the remainder of this mySQL installation guide will assume this is where you are installing mySQL. 
  3. Now you're ready to build and install mySQL.

    Type make <enter>.

    This make process may take a few minutes. After it finishes,  type make install <enter>.

    This step will definitely take a few minutes. After it completes, you should see a bunch of new files in the /usr/local/mysql directory.
  4. Next, you need to initialize mySQL.

    Type cd /scripts <enter>.
    Type ./mysql_install_db <enter>.
  5. Configure the password.

    Type cd /usr/local/mysql <enter>.
    Type ./safe_mysqld& <enter>.
    Type ./mysqladmin -uroot -p[your-password-goes-here] <enter>.
  6. Add mySQL to the Linux Start and Stop Run Levels.

    Type the following in sequence:

    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>.
  7. Reboot your system and test the mySQL installation.

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

    The following response should now be displayed: mysqld is alive
You have now successfully installed mySQL. You might wish to add the mysql bin directory to your PATH.

Jason Lam is a skilled IT professional, programmer, and trainer. You can find his excellent tutorials on his website: http://www.jasonlam604.com

More Interesting Articles

Home     Add URL     Infoblog     Privacy Policy     Advertise     About us     Write for us     Report a broken link     Contact us     Sitemap
Copyright 2003-2017 RLROUSE.COM

RLROUSE.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program
designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com.