Friday, January 30, 2015

How to install MySQL Database using binary source on RHEL(Redhat)/CentOS

MYSQL INSTALLATION AND CONFIGURATION
The following stable production release of mysql should be downloaded from mysql.org mysql-standard-5.0.37-linux-1686-glibc23.tar.gz

Select a machine on which you want to install mysql.
Create a separate partition on the machine named /mysql-db
Copy the tar file and untar into /mysql-db.
After untaring the binary, you may get a directory named mysql-standard-5.0.15-linux-1686-glibc23.
Create a soft link for the same as follows:
#ln -s mysql-standard-5.0.15-linux-1686-glibc23 mysql
#cd /mysql-db/mysql
#cp scripts/mysql_install_db /mysql-db/mysql
#groupadd mysql
#useradd -g mysql -c “MySQL DB User” mysql
#./mysql_install_db –user=mysql

#vi data/my.cnf and make the following changes or copy the my.cnf (backup) file into the following location - /mysql-db/mysql/data/,

[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
# Uncomment the following if you are using InnoDB tables
datadir = /mysql-db/mysql/data
innodb_data_home_dir = /mysql-db/mysql/data
innodb_file_per_table
innodb_data_file_path = ibdata1:100M:autoextend
innodb_log_group_home_dir = /mysql-db/mysql/data/
innodb_log_arch_dir = /mysql-db/mysql/data/
   
Change the user permission for /mysql-db
chown -R mysql.mysql /mysql-db
#vim /etc/init.d/mysql and change the base directory and data directory according to our mysql structure.

Start MySQL
#/etc/ini.d/mysql start

Open the log err-log file present in /mysql-db/mysql/data directory if mysql doesn't started or if error message shown.
If no errors, Mysql have started successfully.
Thast it. we have configured MySQL from binary.

No comments:

Post a Comment