Friday, June 6, 2008

How to install ‘mysql-server’ community 5.1 and client on RHEL 5.0

How to install ‘mysql-server’ community 5.1 and client on RHEL 5.0

Step 1:

First step is to check if there are any version of mysql already installed. This is due to the fact that RHEL has some default packages available already. Do this.

rpm –qa |grep mysql
mysql-connector-odbc-3.51.12-2.2
MySQL-python-1.2.1-1
mysql-5.0.45-7.el5
perl-DBD-MySQL-3.0007-1.fc6
libdbi-dbd-mysql-0.8.1a-1.2.2
mysql-server-5.0.45-7.el5

Printed are a list of mysql server installed, clients and drivers like perl DBD driver, python driver and other stuff. Best idea is to get rid of all these dependencies and build it again. That can be done by

rpm –e < mysql-server-5.0.45-7.el5>
rpm –e < libdbi-dbd-mysql-0.8.1a-1.2.2
…..and so on.


Step 2:

Try installing MySQL server 5.1 from MySQL mirror website itself. It would automatically start the server once successfully installed. ‘root’ is the default user id with a blank password. Root’s password can be changed once client package is installed which includs mysql and mysqladmin and other administrative tools.

rpm –i http://dev.mysql.com/get/Downloads/MySQL-5.1/MySQL-server-community-5.1.24-0.rhel5.i386.rpm/from/http://mirror.trouble-free.net/mysql_mirror/


Step 3:

Try installing MySQL clients packages which include administrative tools like mysql, mysqladmin, mysqldump and others…..

rpm –i http://dev.mysql.com/get/Downloads/MySQL-5.1/MySQL-client-community-5.1.24-0.rhel5.i386.rpm/from/http://mirror.trouble-free.net/mysql_mirror/

Step 4:

Change root user password or simply execute /usr/bin/mysql_secure_installation. Answer all the questions appropriately. That’s it.

Step 5:

Check if mysql is running by doing: ps –eaf|grep mysqld

Also try connecting to it by doing.
mysql –uroot –p
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 38
Server version: 5.1.24-rc-community MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| mysqlDB |
| test |
+--------------------+
4 rows in set (0.00 sec)

====== Now, you are all set =====================

DO NOT FORGET TO RE-INSTALL DRIVERS FOR CLIENTS LIKE PERL, PYTHON, PHP.

No comments: