********************************************************************************
* This is the full install log of mysql database
* 
* Original article: http://www.thegeekstuff.com/2010/04/yum-groupinstall-mysql-database/
* 
********************************************************************************

1. Check whether mysql group bundle is available using grouplist

# yum grouplist
Loaded plugins: fastestmirror
Setting up Group Process
Loading mirror speeds from cached hostfile
 * addons: mirrors.serveraxis.net
 * base: mirrors.versaweb.com
 * extras: mirror.hmc.edu
 * updates: mirror.stanford.edu
Installed Groups:
   Dialup Networking Support
   Editors
   Mail Server
   Network Servers
   System Tools
   Text-based Internet
   Yum Utilities
Available Groups:
   Administration Tools
   Authoring and Publishing
   Base
   Beagle
   Cluster Storage
   Clustering
   DNS Name Server
   Development Libraries
   Development Tools
   Emacs
   Engineering and Scientific
   FTP Server
   FreeNX and NX
   GNOME Desktop Environment
   GNOME Software Development
   Games and Entertainment
   Graphical Internet
   Graphics
   Horde
   Java
   Java Development
   KDE (K Desktop Environment)
   KDE Software Development
   KVM
   Legacy Network Server
   Legacy Software Development
   Legacy Software Support
   Mono
   MySQL Database
   News Server
   Office/Productivity
   OpenFabrics Enterprise Distribution
   PostgreSQL Database
   Printing Support
   Ruby
   Server Configuration Tools
   Sound and Video
   Tomboy
   Virtualization
   Web Server
   Windows File Server
   X Software Development
   X Window System
   XFCE-4.4
Done

2. Identify all the packages that comes with the mysql group bundle

# yum groupinfo "MySQL Database"
Loaded plugins: fastestmirror
Setting up Group Process
Loading mirror speeds from cached hostfile
 * addons: mirrors.serveraxis.net
 * base: mirror.facebook.net
 * extras: mirror.hmc.edu
 * updates: mirror.stanford.edu

Group: MySQL Database
 Description: This package group contains packages useful for use with MySQL.
 Mandatory Packages:
   mysql
 Default Packages:
   MySQL-python
   libdbi-dbd-mysql
   mysql-connector-odbc
   mysql-server
   perl-DBD-MySQL
   unixODBC
 Optional Packages:
   mod_auth_mysql
   mysql-bench
   mysql-devel
   php-mysql
   qt-MySQL


3. Install the mysql database bundle

# yum groupinstall "MySQL Database"
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * addons: mirrors.netdna.com
 * base: mirror.facebook.net
 * extras: mirror.hmc.edu
 * updates: mirror.skiplink.com
Setting up Group Process
Checking for new repos for mirrors
Resolving Dependencies
--> Running transaction check
---> Package MySQL-python.i386 0:1.2.1-1 set to be updated
--> Processing Dependency: mx for package: MySQL-python
---> Package libdbi-dbd-mysql.i386 0:0.8.1a-1.2.2 set to be updated
--> Processing Dependency: libdbi-drivers = 0.8.1a-1.2.2 for package: libdbi-dbd-mysql
---> Package mysql.i386 0:5.0.77-4.el5_4.2 set to be updated
--> Processing Dependency: perl(DBI) for package: mysql
---> Package mysql-connector-odbc.i386 0:3.51.26r1127-1.el5 set to be updated
--> Processing Dependency: libltdl.so.3 for package: mysql-connector-odbc
---> Package mysql-server.i386 0:5.0.77-4.el5_4.2 set to be updated
---> Package perl-DBD-MySQL.i386 0:3.0007-2.el5 set to be updated
---> Package unixODBC.i386 0:2.2.11-7.1 set to be updated
--> Running transaction check
---> Package libdbi-drivers.i386 0:0.8.1a-1.2.2 set to be updated
--> Processing Dependency: libdbi >= 0.8 for package: libdbi-drivers
---> Package libtool-ltdl.i386 0:1.5.22-7.el5_4 set to be updated
---> Package mx.i386 0:2.0.6-2.2.2 set to be updated
---> Package perl-DBI.i386 0:1.52-2.el5 set to be updated
--> Running transaction check
---> Package libdbi.i386 0:0.8.1-2.1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================
 Package                                      Arch                         Version                                     Repository                       Size
=============================================================================================================================================================
Installing:
 MySQL-python                                 i386                         1.2.1-1                                     base                             82 k
 libdbi-dbd-mysql                             i386                         0.8.1a-1.2.2                                base                             17 k
 mysql                                        i386                         5.0.77-4.el5_4.2                            updates                         4.8 M
 mysql-connector-odbc                         i386                         3.51.26r1127-1.el5                          base                            159 k
 mysql-server                                 i386                         5.0.77-4.el5_4.2                            updates                         9.8 M
 perl-DBD-MySQL                               i386                         3.0007-2.el5                                base                            148 k
 unixODBC                                     i386                         2.2.11-7.1                                  base                            832 k
Installing for dependencies:
 libdbi                                       i386                         0.8.1-2.1                                   base                             35 k
 libdbi-drivers                               i386                         0.8.1a-1.2.2                                base                             14 k
 libtool-ltdl                                 i386                         1.5.22-7.el5_4                              updates                          37 k
 mx                                           i386                         2.0.6-2.2.2                                 base                            558 k
 perl-DBI                                     i386                         1.52-2.el5                                  base                            600 k

Transaction Summary
=============================================================================================================================================================
Install     12 Package(s)         
Update       0 Package(s)         
Remove       0 Package(s)         

Total download size: 17 M
Is this ok [y/N]: y
Downloading Packages:
(1/12): libdbi-drivers-0.8.1a-1.2.2.i386.rpm                                                                                          |  14 kB     00:00     
(2/12): libdbi-dbd-mysql-0.8.1a-1.2.2.i386.rpm                                                                                        |  17 kB     00:00     
(3/12): libdbi-0.8.1-2.1.i386.rpm                                                                                                     |  35 kB     00:00     
(4/12): libtool-ltdl-1.5.22-7.el5_4.i386.rpm                                                                                          |  37 kB     00:00     
(5/12): MySQL-python-1.2.1-1.i386.rpm                                                                                                 |  82 kB     00:00     
(6/12): perl-DBD-MySQL-3.0007-2.el5.i386.rpm                                                                                          | 148 kB     00:00     
(7/12): mysql-connector-odbc-3.51.26r1127-1.el5.i386.rpm                                                                              | 159 kB     00:00     
(8/12): mx-2.0.6-2.2.2.i386.rpm                                                                                                       | 558 kB     00:00     
(9/12): perl-DBI-1.52-2.el5.i386.rpm                                                                                                  | 600 kB     00:00     
(10/12): unixODBC-2.2.11-7.1.i386.rpm                                                                                                 | 832 kB     00:00     
(11/12): mysql-5.0.77-4.el5_4.2.i386.rpm                                                                                              | 4.8 MB     00:01     
(12/12): mysql-server-5.0.77-4.el5_4.2.i386.rpm                                                                                       | 9.8 MB     00:01     
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                        4.5 MB/s |  17 MB     00:03     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : perl-DBI                                                                                                                             1/12 
  Installing     : mysql                                                                                                                                2/12 
  Installing     : perl-DBD-MySQL                                                                                                                       3/12 
  Installing     : mx                                                                                                                                   4/12 
  Installing     : libdbi                                                                                                                               5/12 
  Installing     : libtool-ltdl                                                                                                                         6/12 
  Installing     : unixODBC                                                                                                                             7/12 
  Installing     : mysql-connector-odbc                                                                                                                 8/12 
  Installing     : MySQL-python                                                                                                                         9/12 
  Installing     : mysql-server                                                                                                                        10/12 
  Installing     : libdbi-drivers                                                                                                                      11/12 
  Installing     : libdbi-dbd-mysql                                                                                                                    12/12 

Installed:
  MySQL-python.i386 0:1.2.1-1           libdbi-dbd-mysql.i386 0:0.8.1a-1.2.2  mysql.i386 0:5.0.77-4.el5_4.2  mysql-connector-odbc.i386 0:3.51.26r1127-1.el5 
  mysql-server.i386 0:5.0.77-4.el5_4.2  perl-DBD-MySQL.i386 0:3.0007-2.el5    unixODBC.i386 0:2.2.11-7.1    

Dependency Installed:
  libdbi.i386 0:0.8.1-2.1   libdbi-drivers.i386 0:0.8.1a-1.2.2   libtool-ltdl.i386 0:1.5.22-7.el5_4   mx.i386 0:2.0.6-2.2.2   perl-DBI.i386 0:1.52-2.el5  

Complete!

4. Verify the installation

# rpm -qa | grep -i mysql
MySQL-python-1.2.1-1
mysql-5.0.77-4.el5_4.2
mysql-connector-odbc-3.51.26r1127-1.el5
mysql-server-5.0.77-4.el5_4.2
libdbi-dbd-mysql-0.8.1a-1.2.2
perl-DBD-MySQL-3.0007-2.el5

# grep mysql /etc/passwd
mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash

# grep mysql /etc/group
mysql:x:27:

5. Execute mysql_install_db

# /usr/bin/mysql_install_db --user=mysql
Installing MySQL system tables...
100325 14:48:35 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
100325 14:48:35 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
OK
Filling help tables...
100325 14:48:35 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
100325 14:48:35 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

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 dev 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.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl

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

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com

6. MySQL Data directory will contain default databases as shown below.

# grep datadir /etc/my.cnf
datadir=/var/lib/mysql

# ls -l /var/lib/mysql/
total 16
drwx------ 2 mysql root 4096 Mar 25 14:48 mysql
drwx------ 2 mysql root 4096 Mar 25 14:48 test

7. Start mysql server

# service mysqld status
mysqld is stopped

# service mysqld start
Starting MySQL:                                            [  OK  ]

8. Verify the db up and running

# /usr/bin/mysqladmin version
/usr/bin/mysqladmin  Ver 8.41 Distrib 5.0.77, for redhat-linux-gnu on i686
Copyright (C) 2000-2006 MySQL AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version		5.0.77
Protocol version	10
Connection		Localhost via UNIX socket
UNIX socket		/var/lib/mysql/mysql.sock
Uptime:			39 sec

Threads: 1  Questions: 2  Slow queries: 0  Opens: 12  Flush tables: 1  Open tables: 6  Queries per second avg: 0.051

# /usr/bin/mysqlshow
+--------------------+
|     Databases      |
+--------------------+
| information_schema |
| mysql              |
| test               |
+--------------------+

# /usr/bin/mysqlshow mysql
Database: mysql
+---------------------------+
|          Tables           |
+---------------------------+
| columns_priv              |
| db                        |
| func                      |
| help_category             |
| help_keyword              |
| help_relation             |
| help_topic                |
| host                      |
| proc                      |
| procs_priv                |
| tables_priv               |
| time_zone                 |
| time_zone_leap_second     |
| time_zone_name            |
| time_zone_transition      |
| time_zone_transition_type |
| user                      |
+---------------------------+

9. make sure you are able to start and stop the service

# service mysqld stop
Stopping MySQL:                                            [  OK  ]

# /usr/bin/mysqladmin version
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!

# servier mysqld start
-bash: servier: command not found

# service mysqld start
Starting MySQL:                                            [  OK  ]

10.  Change the root account passwords as shown below.

# mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select host, user from mysql.user;
+-----------+------+
| host      | user |
+-----------+------+
| 127.0.0.1 | root | 
| dev       |      | 
| dev       | root | 
| localhost |      | 
| localhost | root | 
+-----------+------+
5 rows in set (0.00 sec)

mysql> set password for 'root'@'localhost' = PASSWORD('NotFor2EveryBody');
Query OK, 0 rows affected (0.00 sec)

mysql> set password for 'root'@'dev' = PASSWORD('NotFor2EveryBody');
Query OK, 0 rows affected (0.00 sec)

mysql> set password for 'root'@'127.0.0.1' = PASSWORD('NotFor2EveryBody');
Query OK, 0 rows affected (0.00 sec)

mysql> 

11. Verify the new password for root account

# mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> exit
Bye