Install MySQL 5.5.23-1 on Linux System.

Your Ad Here

===================================================================================================
==== Install MySQL 5.5.23-1 on Linux System:
===================================================================================================

---------------------------------------------------------------------------------------------------
----1) Download the latest stable release of MySQL
---------------------------------------------------------------------------------------------------

cd /home/oracle/mysql-install
ls -ltr My*

[root@demoapp1]# pwd
/home/oracle/mysql-install
[root@demoapp1]# ls -ltr My*
-rw-r--r-- 1 root root 53204067 Apr 13 17:52 MySQL-server-5.5.23-1.linux2.6.x86_64.rpm
-rw-r--r-- 1 root root 17636739 Apr 13 18:07 MySQL-client-5.5.23-1.linux2.6.x86_64.rpm
-rw-r--r-- 1 root root  6460099 Apr 13 18:50 MySQL-devel-5.5.23-1.linux2.6.x86_64.rpm
[root@demoapp1]#

---------------------------------------------------------------------------------------------------
---- 2) Remove any available mysql installation (If required).
---------------------------------------------------------------------------------------------------

rpm -qa | grep -i mysql

[root@e6stagedb1 bin]# rpm -qa | grep -i mysql
MySQL-server-5.5.23-1.linux2.6
[root@e6stagedb1 bin]#

rpm -e mysql --nodeps

[root@e6stagedb1 bin]# rpm -e MySQL-server --nodeps

[root@e6stagedb1 bin]#
[root@e6stagedb1 bin]# rpm -qa | grep -i mysql
[root@e6stagedb1 bin]#

---------------------------------------------------------------------------------------------------
---- 3) Install the downloaded MySQL package
---------------------------------------------------------------------------------------------------

Remove any old mysql directory from /var/lib directory.

rm -rf /var/lib/mysql
rpm -ivh MySQL-server-5.5.23-1.linux2.6.x86_64.rpm MySQL-client-5.5.23-1.linux2.6.x86_64.rpm


[root@demoapp1]# pwd
/home/oracle/mysql-install
[root@demoapp1]#
[root@demoapp1]# rpm -ivh MySQL-server-5.5.23-1.linux2.6.x86_64.rpm MySQL-client-5.5.23-1.linux2.6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-client           ########################################### [ 50%]
   2:MySQL-server           ########################################### [100%]

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h e6stagedb1.east6.247realmedia.com password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

[root@demoapp1]#

---------------------------------------------------------------------------------------------------
----4) To check Mysql Installation:
---------------------------------------------------------------------------------------------------

cd /usr/bin
ls -ltr 
cd /var/lib/mysql
ls -ltr 

[root@e6stagedb1 bin]# pwd
/usr/bin
[root@e6stagedb1 bin]# ls -ltr mysql*
-rwxr-xr-x 1 root root    3888 Mar 30 03:26 mysql_zap
-rwxr-xr-x 1 root root   17473 Mar 30 03:26 mysql_setpermission
-rwxr-xr-x 1 root root    8066 Mar 30 03:26 mysql_secure_installation
-rwxr-xr-x 1 root root   14849 Mar 30 03:26 mysql_install_db
-rwxr-xr-x 1 root root   32819 Mar 30 03:26 mysqlhotcopy
-rwxr-xr-x 1 root root    1261 Mar 30 03:26 mysql_fix_extensions
-rwxr-xr-x 1 root root    3315 Mar 30 03:26 mysql_find_rows
-rwxr-xr-x 1 root root    7402 Mar 30 03:26 mysqldumpslow
-rwxr-xr-x 1 root root   23070 Mar 30 03:26 mysqld_safe
-rwxr-xr-x 1 root root   23199 Mar 30 03:26 mysqld_multi
-rwxr-xr-x 1 root root    4245 Mar 30 03:26 mysql_convert_table_format
-rwxr-xr-x 1 root root   11220 Mar 30 03:26 mysqlbug
-rw-r--r-- 1 root root    1702 Mar 30 03:26 mysqlaccess.conf
-rwxr-xr-x 1 root root  111560 Mar 30 03:26 mysqlaccess
-rwxr-xr-x 1 root root 3945691 Mar 30 03:26 mysql_waitpid
-rwxr-xr-x 1 root root 3794385 Mar 30 03:27 mysql_tzinfo_to_sql
-rwxr-xr-x 1 root root 3988487 Mar 30 03:29 mysql_plugin
-rwxr-xr-x 1 root root 7664777 Mar 30 03:29 mysql
-rwxr-xr-x 1 root root 4077714 Mar 30 03:29 mysql_upgrade
-rwxr-xr-x 1 root root 6773018 Mar 30 03:29 mysqlcheck
-rwxr-xr-x 1 root root 6790119 Mar 30 03:29 mysqladmin
-rwxr-xr-x 1 root root 6784247 Mar 30 03:29 mysqlimport
-rwxr-xr-x 1 root root 7005108 Mar 30 03:29 mysqldump
-rwxr-xr-x 1 root root 6826174 Mar 30 03:29 mysqlslap
-rwxr-xr-x 1 root root 6767035 Mar 30 03:29 mysqlshow
-rwxr-xr-x 1 root root 7394945 Mar 30 03:29 mysqlbinlog
-rwxr-xr-x 1 root root 7392170 Mar 30 03:29 mysqltest
[root@e6stagedb1 bin]#

[root@e6stagedb1 mysql]# pwd
/var/lib/mysql
[root@e6stagedb1 mysql]# ls -ltr
total 20
drwxr-xr-x 2 mysql mysql 4096 Apr 13 18:16 test
-rw-r--r-- 1 mysql mysql  116 Apr 13 18:16 RPM_UPGRADE_MARKER-LAST
-rw-r--r-- 1 root  root   116 Apr 13 18:16 RPM_UPGRADE_HISTORY
drwx------ 2 mysql mysql 4096 Apr 13 18:16 performance_schema
drwx--x--x 2 mysql mysql 4096 Apr 13 18:16 mysql
[root@e6stagedb1 mysql]#

-- Start Mysql database (This is not mandatory)

service mysql status
service mysql start

[root@demoapp1]# service mysql status
MySQL is not running                                       [FAILED]
[root@demoapp1]#
[root@demoapp1]# service mysql start
Starting MySQL..                                           [  OK  ]
[root@demoapp1]#

---------------------------------------------------------------------------------------------------
----4) Install the “Header and Libraries” that are part of the MySQL-devel packages.
---------------------------------------------------------------------------------------------------

cd /home/oracle/mysql-install
rpm -ivh MySQL-devel-5.5.23-1.linux2.6.x86_64.rpm

[root@demoapp1]#
[root@demoapp1]# rpm -ivh MySQL-devel-5.5.23-1.linux2.6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-devel            ########################################### [100%]
[root@demoapp1]#

---------------------------------------------------------------------------------------------------
----5) Perform post-install security activities on MySQL.
---------------------------------------------------------------------------------------------------

==== Setup Up Root Password: 
( NOTE :- This steps is not mandatory since post installation program also setup root pasword)

/usr/bin/mysqladmin -u root password 'root.123'


[root@demoapp1]# /usr/bin/mysqladmin -u root password 'root.123'

The best option is to run the mysql_secure_installation script that will take care of all the 
typical security related items on the MySQL as shown below. On a high level this does the following items:

-- Change the root password
-- Remove the anonymous user
-- Disallow root login from remote machines
-- Remove the default sample test database

[root@demoapp1]#

=== Execute Post Installation program:

/usr/bin/mysql_secure_installation


[root@demoapp1]# /usr/bin/mysql_secure_installation

NOTE: Post installation program also setup the root password.

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] Y
 ... Success!

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] Y
 ... Success!

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] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

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

Reload privilege tables now? [Y/n] Y
 ... Success!

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@demoapp1]#

---------------------------------------------------------------------------------------------------
---6)  Verify the MySQL installation :
---------------------------------------------------------------------------------------------------

=== Check MySql Version:
mysql -V


[root@demoapp1]# mysql -V
mysql  Ver 14.14 Distrib 5.5.23, for Linux (x86_64) using readline 5.1
[root@demoapp1]#

=== Connect to the MySQL database using the root user and make sure the connection is successfull

mysql -u root -p

[root@demoapp1]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.5.23 MySQL Community Server (GPL)

Copyright (c) 2000, 2011, 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>


---------------------------------------------------------------------------------------------------
----7) Steps to start and stop MySQL Database :
---------------------------------------------------------------------------------------------------


[root@demoapp1]# service mysql status
MySQL running (23263)                                      [  OK  ]
[root@demoapp1]#
[root@demoapp1]# service mysql stop
Shutting down MySQL.                                       [  OK  ]
[root@demoapp1]#
[root@demoapp1]# service mysql start
Starting MySQL..                                           [  OK  ]
[root@demoapp1]#

===================================================================================================
==== End Of File
===================================================================================================


4 comments »

Leave a Comment

 

1 Trackback \ Ping »

Your Ad Here
Your Ad Here