Tuesday 25 October 2011

Installing MySQL 5.5 using RPM

Installing MySQL 5.5
Overview 
Installing MySQL using RPM is most used and the most simple method of installing the MySQL on Linux based platforms. Here we will be using an RHEL 5 environment to install MySQL.

MySQL has two base RPM which are mandatory to install to use MySQL on your server

1. Server Software RPM package
2. Client Software RPM package

The server software RPM is the core RPM which installs the MySQL on your server. The client software RPM installs the client through which you can communicate to the MySQL Database.

Below is how they look like
-rw-r--r-- 1 mysql mysql  18191603 Jun 13 23:40 MySQL-client-5.5.13-1.rhel5.x86_64.rpm
-rw-r--r-- 1 mysql mysql  53626402 Jun 13 23:40 MySQL-server-5.5.13-1.rhel5.x86_64.rpm

Installing the packages

Any RPM package installation is done using rpm -ivh <<package-name>>, Similarly we shall also install these packages using the same syntax. Before installing the package, we shall also need to check if these packages are already existing using below command.

 rpm -qa | grep -i '^mysql-'

If the above commands does not list you any packages, the you can install the MySQL RPM.

Firstly you need to install the server package and then you need to install the client package

rpm -ivh MySQL-server-advanced-gpl-5.1.46sp1-1.rhel5.x86_64.rpm
rpm -ivh MySQL-client-advanced-gpl-5.1.46sp1-1.rhel5.x86_64.rpm

With the above two commands, the MySQL installation is completed.

How to remove an existing MySQL package

Removing of MySQL RPM is similar to searching the package as said above, it additionally has xargs command which shall remove the package.

 rpm -qa | grep -i '^mysql-' | xargs rpm --nodeps -ev

No comments:

Post a Comment