Sunday, November 17, 2013

Step by Step MYSQL 5.5 Installation

                    [ I have implemented this MYSQL 5.5 installation on OEL 5.5 ] 


1.
Download the following Mysql Binaries... and login as root user  in Linux operation system and change the permission and change the ownership of the binaries..

ex:  ( I have done this on one file follow the same steps on all the three files )
#chmod 777 MySQL-client-5.5.31-1.rhel5.x86_64.rpm
#chown  oracle:oinstall MySQL-client-5.5.31-1.rhel5.x86_64.rpm

[root@rak3 Mysql Binaries]# ls -lrt
total 80632
-rwxrwxrwx 1 oracle oinstall 18295684 Apr 29 12:32 MySQL-client-5.5.31-1.rhel5.x86_64.rpm
-rwxrwxrwx 1 oracle oinstall  3887652 Apr 29 12:40 MySQL-devel-5.5.31-1.rhel5.x86_64.rpm
-rwxrwxrwx 1 oracle oinstall 55160490 Apr 29 12:54 MySQL-server-5.5.31-1.rhel5.x86_64.rpm


2.
Install the downloaded Mysql binaries on the Linux operation system as root user.

[root@rak3 Mysql Binaries]# rpm -ivh MySQL-server-5.5.31-1.rhel5.x86_64.rpm MySQL-client-5.5.31-1.rhel5.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-client           ########################################### [ 50%]
   2:MySQL-server           ########################################### [100%]


3.
PLEASE REMEMBER TO SET  PASSWORD FOR THE MySQL root USER !!!!!

#/usr/bin/mysqladmin -u root password 'mysql'
Starting MySQL..                                           [  OK  ]

Note: my root password for mysql login is : mysqladmin


4.
Alternatively you can run:
(This is optional installation step if you are building production database you can avoid sample database on the mysql database.. for the learning you can keep it..  It ask's for your permission. Read the requirement just type yes/no.. In my case I've printed No for all options :-)


[root@rak3 ~]# /usr/bin/mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

You already have a root password set, so you can safely answer 'n'.

Change the root password? [Y/n] n
 ... skipping.

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] n
 ... skipping.

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n
 ... skipping.

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] n
 ... skipping.

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] n
 ... skipping.

Cleaning up...

All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

[root@rak3 ~]#



5.
Starting the Mysql database using the below command. 

#sudo /etc/init.d/mysql start

To verify Mysql background running or not (if  mysql started successfully then you can see this BG processor)
[root@rak3 ~]# ps -ef | grep mysqld
root      5391     1  0 13:22 pts/1    00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/rak3.saravanan.com.pid
mysql     5485  5391  0 13:22 pts/1    00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/rak3.saravanan.com.err --pid-file=/var/lib/mysql/rak3.saravanan.com.pid
root      5532  7958  0 13:23 pts/1    00:00:00 grep mysqld


6.
To verify the install mysql binaries on the Linux operation system

[root@rak3 ~]# rpm -qa | grep -i mysql
MySQL-server-5.5.31-1.rhel5
MySQL-client-5.5.31-1.rhel5


7.
Installing the remaining mysql binary to the Linux operation system

[root@rak3 Mysql Binaries]# rpm -ivh MySQL-devel-5.5.31-1.rhel5.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-devel            ########################################### [100%]
[root@rak3 Mysql Binaries]#

To verify the installed version of Mysql  on the Linux operation system.
[root@rak3 Mysql Binaries]# mysql -V
mysql  Ver 14.14 Distrib 5.5.31, for Linux (x86_64) using readline 5.1


8.

Login into Mysql as root user  ( In section 3 we already created password mysqladmin )

[root@rak3 Mysql Binaries]# mysql -u root -p
Enter password:                                                    <-- here you need to enter password

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.31 MySQL Community Server (GPL)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

No comments:

Post a Comment