How To Install MySql 5.5 On CentOS 5/6?

How To Install MySql 5.5 On CentOS 5/6?

Introduction of MySql

MySQL is one of the most popular database management system used in today’s web scenario. Mysql is used for data driven website and also for the websites where data is generated according to the user need.

This article will help you to learn how to install MySql 5.5. You just have to follow very simple steps, with YUM manager. YUM makes it really easy by avoiding the compilation process and install them easily with installing all other dependencies and also you are notified of updates.

Scenario: My Server IP is

Note: If you are a SUDO user then prefix every command with sudo, like #sudo ifconfig

Step 1: Get The Remi Repository

The most f the updated package is available under Remi repository. Install it in your system using following commands.

Step 2: System Update

To ensure that every package on the server is updated. Run the following command to update package on your server

Step 3: Install MySql

Now Type in the following command to install MySql server

#yum –enablerepo=remi install mysql mysql-server

Step 4: Start MySql

Now we have installed our MySql server and we need to start the service. the following command will start the MySql server.

After hitting above command you will see following lines

Step 5: Securing With Password

When Mysql server is started then you need to secure with a password and you can do it by typing command generated above (I have Highlighted)

Soon after starting the MySql it will bind itself with localhost( on port 3306.You may see its configuration file at /etc/my.cnf. If you want to bind your public IP with MySql then you make changes in the same file. But for security, you need to add some rules in firewall for specific IP address to get connect

Step 6: MySql Server Hardening

When MySql is installed, there is some default configuration which may be the security threats. Mysql provides a script to remove few security threats known as “mysql_secure_installatio”.

Now give you input to text based MySql hardening script

 Step 7: Test Your Installation

When the database server is started then we can access MySql database by using MySql client through terminal with the following command

  1. Via Root Login

After hitting Enter button you will be asked to put in your password. Enter and password then you will get the login and you will see the MySql shell display:

Few Management Command For MySql

To stop your MySql:

To start MySql, type:

To restart the service again, type:

To Restart automatically when the server is rebooted:

To generate a list of commands for the MySQL prompt, enter \h. You’ll then see:

Thanks for Reading, I hope this information was good enough

Read How To Setup LAMP environment

Love to write technical stuff with personal experience as I am working as a Sr. Linux Admin. and every day is a learning day and Trust me being tech geek is really cool.

Leave a Reply