Home » Science » Computer Science » How to Install MySQL for Linux

How to Install MySQL for Linux

The installation process of MySQL 5.6.x (community) on Linux, using the distribution from MySQL AB. if you’re using another flavor of UNIX, download appropriate files and follow the instructions included with the distribution.


The recommended installation method for MySQL is with RPM’s. There are several RPM’s that make up a full distribution, but  for a minimal installation you need the following ;


  • MySQL-server-VERSION.i386.rmp-The MySQL server.
  • MySQL-client-VERSION.i386.rpm-The standard MySQL client programs.

To download these files, visit the MySQL 5.6.x download page at http://dev.mysql.com/downloads/mysql/ and find the “Linux x86 RPM downloads” section on the page (or IA64 or AMD64, depending on your architecture). When you click the download link for one of the packages, you will be taken to a page of mirror sites. Select the mirror site closest to you and download the files.


how to install mysql in linux (1)


When the files are downloaded to your system, perform the minimal installation by typing the following at your prompt, replacing VERSION with the appropriate version number of your downloaded files:


#prompt> rpm -i MySQL-server-VERSION. i386.rpm MySQL-client-VERSION. i386.rpm

if the RPM method doesn’t work for you, you can also install MySQL from a binary distribution, with requires gunzip and tar  to uncompress and unpack the distribution and also requires the capability create grous and users on the system,


in the first series of commands, you will add a group and a user and then unpack the distribution , as follows:

  1. At the prompt, type groupadd mysql.

  2. At the prompt, type useradd -g mysql mysql.

  3. At the prompt , type  cd/user/local.

  4. At the  prompt, type   gunzip < /path/to/mysql-standard-VERSION-OS.tar.gz | tar xvf –  .

  5. To create a link with the shorter name, type In – mysql-VERSION-OS mysql.

  6. change directories by typing cd mysql.

Once the distribution is unpack, the read me and install files will walk you through the remainder of the installation process for the version of MySQL you’ve chosen. In general, the next series of commands will be used:


  1. Type scripts/mysql_install_db to run the MySQL install script.

  2. Type chown -R root   /user/local/mysql    to change ownership of the mysql directory.

  3. Type chown  -R   mysql   /user/local mysql/data to change ownership of the mysql/data directory.

  4. Type chgrp  -R mysql  /user/local/mysql to change the group of the mysql directory.

  5. Type chown  _R root  /user/local/mysql/bin to change ownership of the mysql/bin directory.

If you have any problems during the installation of MySQL, the first place you should look is the “Problems and Common  Errors”

Some Common Problems :

  • Incorrect permission do not allow you to start the MySQL daemon. If this is the case, be sure you have change owners and groups to match those indicated in the installation instructions.
  • If you see the message Access denied when connecting to MySQL, be sure you are using the correct username and password.
  • If you see the message Can’t connect to server, make sure the MySQL daemon is running.




The main objective of this website is to provide quality study material to all students (from 1st to 12th class of any board) irrespective of their background as our motto is “Education for Everyone”. It is also a very good platform for teachers who want to share their valuable knowledge.

Leave a Reply

Your email address will not be published. Required fields are marked *