mysql database installation

How to install Mysql Database Server on Redhat Linux

In this article i’m going to show you mysql database installation step by step on Redhat Linux.

For the mysql database installation we have required mysql rpm files. You can find out these rpm files from your os CD or from your YUM repository.

What is MySQL Read Here

If YUM server not configured on your machine, click here and check how to configure yum server.

For RHEL 5 and 6 use following command as Root user.
#yum install mysql-server mysql
For RHEL 3 and 4 use following command as Root user.
#up2date mysql-server mysql

After installing above rpm start the MySQL servers using following commands.

#chkconfig mysqld on
#/etc/init.d/mysqld start

Now make a password for rood user of Mysql using following command.

#mysqladmin -u root password yourpassword

Now check the Mysql connection using following command

# mysql -u root -p

Now we need to configure Mysql  Server, add the following settings in /etc/my.cnf file, you must be remember the following values are sample values, set it as per your requirements.

#mysql settings
query_cache_type = 1
query_cache_limit = 1M
query_cache_size = 32M

# For MyISAM buffer size and recover options
key_buffer_size = 24M
myisam_recover = FORCE,BACKUP

# LOGGINGS for slow query
log_queries_not_using_indexes = 1
slow_query_log = 1
slow_query_log_file = /var/lib/mysql/mysqld-slow-query.log

#cache and other limits

tmp_table_size = 32M
max_heap_table_size = 32M
max_connections = 500
thread_cache_size = 50
open_files_limit = 65535
table_definition_cache = 4096
table_open_cache = 512

Save the above file and restart or reload the Mysql service using following commands.

 #/sbin/service mysqld restart 


#/sbin/service mysqld reload

Create Database and check it using following command

#mysql -u root -p
mysql> create database ocpgroup;
mysql> show databases;
| Database           |
| information_schema |
| mysql              |
| ocpgroup           |
| test               |
4 rows in set (0.00 sec)

Your MySQL database server installation has been done, Hope you enjoyed it, Please write a comment in comment box about this article.

You Can subscribe my YouTube channel

Share this

2 thoughts on “How to install Mysql Database Server on Redhat Linux”

Leave a Comment