Saturday 24 March 2012

MySQL Binary Installation

About MySQL Binary Installation

MySQL binary installation is the easiest way of installing MySQL. If you have very little knowledge of linux you will be able to do this installation comfortably.

Steps For Binary Installation

  1.  Download the suitable binary package from mysql.com (as per the OS requirement)
  2. create mysql user and mysql group
    • groupadd mysql
    • useradd -r -g mysql mysql
  3. untar the binary package which you have downloaded from internet.
    • tar zxvf  /path-to-tar-file/mysql-version-package.tar.gz
  4. Put the untarred Directory in any directory other than / or /root/
  5. Create symbolic link
    • ln -s path-to-untarred-mysql/mysql-version mysql (this will let you communicate with original untarred mysql directory without specifying long complete directory name i.e. mysql-5.5.9-linux...... )
  6.  cd mysql
  7. Change to ownership of mysql directory
    • chown -R mysql .
    • chgrp -R mysql .
  8. Run the mysql_install_db script to create necessary file and system files which are required to run mysql
    • path-to-mysql/scripts/mysql_install_db --user=mysql
    • or
    • go to scripts directory in the mysql directory
    • ./mysql_install_db --user=mysql
  9.  chown -R root .
  10. chown -R mysql data

With this mysql installation is complete. Above mentioned steps are mandatory for mysql installation and following steps are optional.

1. cp mysql/support-files/my.cnf /etc/my.cnf
(my.cnf is the configuration file through with you can customize the mysql environment)
2. bin/mysqld_safe --user=mysql &
(this will start mysql server)
3. cp support-files/mysql.server /etc/init.d/mysql.server

 I will keep posting as and when I will get time. Cheers.........