How to Install MySQL Server 5 in CentOS 6.x and Red Hat 6.x Linux?

How to Install MySQL Server 5 in CentOS 6.x and Red Hat 6.x Linux?

Let’s learn how to install MySQL Server 5.6 in CentOS 6.x and RHEL 6.x with the help of yum command. This whole package is Architecture Independent. So its compatible with32 bit(i386) and 64 bit(x86_64) operating systems.

System specification

Arch: x86_64 and i386 (Both)

Operating System: CentOS 6.5

Here are the steps to install MySQL server

Step 1: Click on the link below to download the yum repo rpm package.


  yum install wget

Step 2: Install the downloaded rpm package.

  rpm -ivh mysql-community-release-el6-5.noarch.rpm

Step 3: By using yum command install MySQL server.Now install the MySQL server by using yum command.By default, all dependencies will be installed by yum command.

  yum install mysql-server

Step 4: Start MySQL server after installation

  /etc/init.d/mysqld start

Step 5: The default MySQL root password is blank. Reset the root password using the following command.


You may try this alternative too.

  mysql -u root

Once you login you will get a MySQL prompt. Run the command given below.

  mysql> use mysql;
  mysql> update user set password=PASSWORD(“GIVE-NEW-ROOT-PASSWORD”) where User=’root’;
  mysql> flush privileges;
  mysql> quit