1. List down all the installed Mysql RPM's

[root@achappan mysql]# rpm -qa | grep MySQL
MySQL-server-5.5.*-1.rhel5
MySQL-client-5.5.*-1.rhel5
perl-DBD-MySQL-3.0007-2.el5
[root@achappan mysql]#

2. Remove MySQL-server and MySQL-client from the list

[root@achappan mysql]# rpm -e MySQL-server-5.5.*-1.rhel5
[root@achappan mysql]# rpm -e MySQL-client-5.5.*-1.rhel5

3.  Verify the uninstalled rpms are removed from the list or not.

[root@achappan mysql]# rpm -qa | grep MySQL
perl-DBD-MySQL-3.0007-2.el5
[root@achappan mysql]#

4.  Find the list of mysql directories from system

[root@achappan mysql]# find / -name mysql

/etc/rc.d/init.d/mysql
/etc/logrotate.d/mysql
/usr/bin/mysql
/usr/lib/mysql
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/DBD/mysql
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/DBD/mysql
/usr/share/mysql
/var/lib/mysql
/var/lib/mysql/mysql
/var/lock/subsys/mysql
/var/run/sudo/mysql

 5. Rename or Delete the highlighted mysql directories from the list.

 6. Go to RPMs directory which you are downloaded latest rpms from mysql site.

[root@achappan mysql rpm]# ls -l
total 612100
-rw-r--r-- 1 root root  313067520 Apr 13 15:14 MySQL-5.6.24-1.rhel5.i386.rpm-bundle.tar
-rw-r--r-- 1 7155 wheel  22883979 Mar 26 16:27 MySQL-client-5.6.24-1.rhel5.i386.rpm
-rw-r--r-- 1 7155 wheel   4136019 Mar 26 16:27 MySQL-devel-5.6.24-1.rhel5.i386.rpm
-rw-r--r-- 1 7155 wheel 113129185 Mar 26 16:27 MySQL-embedded-5.6.24-1.rhel5.i386.rpm
-rw-r--r-- 1 7155 wheel  89185903 Mar 26 16:28 MySQL-server-5.6.24-1.rhel5.i386.rpm
-rw-r--r-- 1 7155 wheel   2371167 Mar 26 16:29 MySQL-shared-5.6.24-1.rhel5.i386.rpm
-rw-r--r-- 1 7155 wheel   5466510 Mar 26 16:29 MySQL-shared-compat-5.6.24-1.rhel5.i386.rpm
-rw-r--r-- 1 7155 wheel  75885537 Mar 26 16:29 MySQL-test-5.6.24-1.rhel5.i386.rpm
[root@achappan mysql rpm]#

7. Install MySQL-server and MySQL-client Rpms

[root@achappan mysql rpm]# rpm -i MySQL-server-5.6.24-1.rhel5.i386.rpm

After the MySQL Server  installation it will provide the Mysql root password in mysql_secret file under the root dir (/root/.mysql_secret)

Then install MySQL Client. You probably always want to install this package.
 [root@achappan mysql rpm]# rpm -i MySQL-client-5.6.24-1.rhel5.i386.rpm

8. Get MySQL Random generated root password

[root@achappan mysql rpm]# cat /root/.mysql_secret
# The random password set for the root user at Mon Apr 13 21:01:17 2015 (local time): mO4rRAW7Xr6Xdcy6

9. Start the mysql

[root@achappan mysql rpm]# /etc/init.d/mysql start

MySQL running (32751)                                      [  OK  ]
[root@achappan mysql rpm]#

10. Change the mysql password for your convenient.

[root@achappan mysql]# mysql -u e3user -p
Enter password: ******

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

Copyright (c) 2000, 2015, 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>
mysql> show databases;
+----------------------------------------+
| Database                               |
+----------------------------------------+
| information_schema                     |
| mysql                                  |
| performance_schema                     |
| test                                   |
+----------------------------------------+
4 rows in set (0.02 sec)
mysql> use  mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('e3_user');
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;

0 comments:

Blog Archive

Total Pageviews

Popular Posts