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/

10 comments:

  1. 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
  2. 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

  3. Remarkable! Its in fact remarkable paragraph, I have got much clear idea concerning from this article.I see something really special in this internet site.

    explorecrack.com

    brave-browser-crack

    bandicam-crack-product-key

    wondershare-filmora-crack

    explorecrack.com

    ReplyDelete
  4. I like the helpful information you provide in your articles.I’ll bookmark your blog and test once more right here regularly.I am relatively sure I’ll be told a lot of new stuff right right here! Good luck for the next!
    Any Video Converter Crack
    ESET Internet Security Crack
    VueScan Crack
    Smadav Pro Crack
    Minecraft Crack
    KeyShot Pro Crack
    Avast Antivirus Crack

    ReplyDelete