MYSQL installation from tar.gz file

Dependencies Installation

yum install ncurses-devel

Download tar.gz file of mysql

wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.11.tar.gz/from/http://cdn.mysql.com/

 Extracting tar.gz file

tar -xzvf mysql-5.6.11.tar.gz

Entering to extracted directory

cd mysql-5.6.11

User and Group adding and setting permissions

groupadd mysql

useradd -r -g mysql mysql

mkdir /usr/local/mysql

Configuring and Installing

./configure –prefix=/usr/local/mysql –localstatedir=/usr/local/mysql/data –disable-maintainer-mode –with-mysqld-user=mysql –with-unix-socket-path=/tmp/mysql.sock –without-comment –without-debug –without-bench

make

make install

Set up MySQL’s internal database

./scripts/mysql_install_db

To set the proper ownership for the MySQL directories and data files, so that only MySQL (and root) can do anything with them

chown -R root:mysql /usr/local/mysql
chown -R mysql:mysql /usr/local/mysql/data

To copy the default configuration file for the expected size of the database

cp support-files/my-medium.cnf /etc/my.cnf
chown root:sys /etc/my.cnf
chmod 644 /etc/my.cnf

To tell the system where to find some of the dynamic libraries that MySQL will need to run. We use dynamic libraries instead of static to keep the memory usage of the MySQL program itself to a minimum

echo “/usr/local/mysql/lib/mysql” >> /etc/ld.so.conf
ldconfig

To enables MySQL auto-start each time server is restarted

cp ./support-files/mysql.server /etc/rc.d/init.d/mysql
chmod +x /etc/rc.d/init.d/mysql
/sbin/chkconfig –level 3 mysql on

To set up symlinks for all the MySQL binaries, so they can be run from anyplace without having to include/specify long paths

cd /usr/local/mysql/bin
for file in *; do ln -s /usr/local/mysql/bin/$file /usr/bin/$file; done

Starting MySQL
/etc/rc.d/init.d/mysql start

To set a password ‘redhat’ for the MySQL root user

/usr/local/mysql/bin/mysqladmin -u root password redhat

Test MySQL by entering using password redhat
/usr/local/mysql/bin/mysql -u root -p redhat

Leave a Reply

Your email address will not be published. Required fields are marked *