Tuesday, July 17, 2012

Install and Configure MySQL using Generic Unix or Linux Binaries

Oracle provides the Generic binaries in the form of tar files. Using generic binaries you will be able to control the configuration and layout.

The MYSQL compressed tar files have names of the form mysql-version-OS.tar.gz.

Generic Unix/Linux Binaries Installation layout
Directory  Contents of Directory
bin            Client programs and the mysqld server
data          Log files, databases
docs         Manual in Info format
man          Unix manual pages
include     Include (header) files
lib            Libraries
scripts      mysql_install_db scripts
share        Miscellaneous support/sample configuration/Install files, including error messages
sql-bench Benchmarks

Before you install, make sure that there are no previous versions of mysql, unless you want to use older version of MySQL.

Command to find old rpms installed on the system
# rpm -qa | grep -i ^mysql
Command to find old mysql directories/files
# Find . –name *mysql* -print
Command to find mysql server process
# ps –ef | grep mysql

Follow the steps to Install and configure MySQL

1. Create mysql user and group
# groupadd -g 100 mysql
# useradd -u 100 -s ksh -d /u01/mysql -r -g mysql mysql
# chown -R mysql:mysql /u01/mysql

2. Login as Mysql and unpack the distribution
# su – mysql
$ tar zxvf /u01/mysql-5.0.45.tar.gz
Create a soft link to 5.0.45
# ln -s /u01/mysql/mysql-5.0.45 5.0.45

3. Create a profile and set the profile
-----.profile file----
MYSQL_BASE=/u01/mysql; export MYSQL_BASE
MYSQL_HOME=/u01/mysql/5.0.45; export MYSQL_HOME
PATH=$MYSQL_HOME/bin:$PATH ; export PATH
Set the profile
$ . ./.profile

4. Copy sample configuration file and edit the file according to your environment.
$ cp /u01/mysql/5.0.45/support-files/my-small.cnf $MYSQL_HOME/my.cnf
-----my.cnf file----
[mysqld]
datadir=/u01/mysql/data
socket=/u01/mysql/mysql.sock

innodb_data_home_dir=/u01/mysql/innodata
innodb_data_file_path=ibdata1:10M:autoextend:max:3000M
innodb_log_group_home_dir=/u01/mysql/innologs
user=mysql

[mysqld_safe]
log-error=/u01/mysql/mysqld.log
pid-file=/u01/mysql/mysqld.pid
[client]
socket=/u01/mysql/mysql.sock

5. Create mysql database files for mysql server.
$ scripts/mysql_install_db --datadir=/u01/mysql/5.0.45/data --basedir=$MYSQL_HOME

This command creates the default database schemas

6. Start the MySQL Server
$ mysqld_safe --defaults-file=$MYSQL_HOME/my.cnf &

Here we have placed the my.cnf under MYSQL_HOME. You can copy the configuration file to any location and use the path while starting the mysql server.

7. Verify the Mysql process and logs
$ ps –ef  | grep mysql

Verify the error log (log-error=/u01/mysql/mysqld.log) under the path that you mentioned in the my.cnf

Regards,
Satishbabu Gunukula
http://www.oracleracexpert.com/

12 comments:

  1. Thanks for sharing this post.
    Play Real money and bitcoin poker games such as Texas Hold'em at Ignition Poker on your desktop or mobile.
    Play Poker Online India
    Poker tournaments in India
    How to play poker
    Real Money Poker

    ReplyDelete
  2. We take charge with 24/7 Emergency Alarm response notification you have an option with us to do it yourself or have a monitoring supervisor do it for you. we believe in providing Tailored security as per each individual client.
    Help is only a button press away – all our operators speak with the user directly through the Medical Alert. No landline or installation required – Product arrives ready to use.
    Mobile Medical Alert System enables the user to alert an Emergency wherever, whenever. Automatic Fall Detection features, incase you can't press the button. Magnetic charger and voice activation for the partially sighted and those with dexterity.
    Download our APP for Android & IOS – Suitable for Family members or carers. Receive instant SOS and Fall notifications wherever, whenever. Have full control over your loved one's preferences and talk directly to user through your smartphone to the Medical Alert System. Brahma Yoga corporate wellness programs in Gurgaon

    ReplyDelete
  3. This is my first time i visit here. I found so many interesting stuff in your blog.From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here keep up the good work.
    Parallel Desktop Crack

    ReplyDelete
  4. I think this is one of the most vital info for me. And i am glad reading your article.Good job, cheers!
    Cracked Mac Apps

    ReplyDelete