STEP BY STEP UPGRADE MYSQL 5.6 TO MYSQL 8.0 USING RPM.
![]() |
| Upgrade to mysql 8.0 |
STEP-1: Extract tar file.
New default config file was created as /usr/my.cnf and will be used by default by the server when you
[root@ctpdb1 MY56]# tar -xvf MySQL-5.6.48-1.el6.x86_64.rpm-bundle.tar
MySQL-devel-5.6.48-1.el6.x86_64.rpm
MySQL-client-5.6.48-1.el6.x86_64.rpm
MySQL-embedded-5.6.48-1.el6.x86_64.rpm
MySQL-server-5.6.48-1.el6.x86_64.rpm
MySQL-shared-compat-5.6.48-1.el6.x86_64.rpm
MySQL-shared-5.6.48-1.el6.x86_64.rpm
MySQL-test-5.6.48-1.el6.x86_64.rpm
STEP-2: Now install server,client,common,libs-compat,libs packages from above extracted files.
[root@ctpdb1 MY56]# rpm -Uvh MySQL-devel-5.6.48-1.el6.x86_64.rpm
[root@ctpdb1 MY56]# rpm -Uvh MySQL-embedded-5.6.48-1.el6.x86_64.rpm
[root@ctpdb1 MY56]# rpm -Uvh MySQL-shared-compat-5.6.48-1.el6.x86_64.rpm
[root@ctpdb1 MY56]# rpm -Uvh MySQL-shared-5.6.48-1.el6.x86_64.rpm
[root@ctpdb1 MY56]# rpm -Uvh MySQL-server-5.6.48-1.el6.x86_64.rpm
start it. You may edit this file to change server settings.
STEP-3: Start Mysql Services.
Check root user password.
[root@ctpdb1 MY56]# service mysql start
Starting MySQL.Logging to '/var/lib/mysql/ctpdb1.err'.
[root@ctpdb1 MY56]# cat /root/.mysql_secret
STEP-4:
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
It will ask about changing root user password , Remove anonymous users?, remove test database, Disallow root login remotely?, Remove test database and access to it?
Reloading the privilege tables will ensure that all changes made so far will take effect immediately, Reload privilege tables now?
Answer depend on your use.
[root@ctpdb1 MY56]# /usr/bin/mysql_secure_installation
All done! If you've completed all of the above steps, your MySQL installation should now be secure.
STEP-5:Login to mysql 5.6 database.
[root@ctpdb1 MY56]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.6.48 MySQL Community Server (GPL)
sql>select version
+-----------+
| version() |
+-----------+
| 5.6.48 |
+-----------+
STEP-6:Stop mysql 5.6 services and extract mysql 5.7 tar files.
Now upgrade the Mysql 5.6 to 5.7 using below command, also you can use rpm -ivh command to upgrade mysql database. ex. rpm -ivh mysql-community-{server,client,common,libs-compat,libs}-* mysql-5.*.
Now start service of mysql 5.7 database.
STEP-8: Upgrading to Mysql 8.0 from Mysql 5.7 using RPM[root@ctpdb1 ~]# service mysql stop
Shutting down MySQL.. [ OK ]
[root@ctpdb1 ~]# cd /CTPPROD/SOFTWARE/MY57/
[root@ctpdb1 MY57]# tar -xvf mysql-5.7.31-1.el6.x86_64.rpm-bundle.tar
mysql-community-test-5.7.31-1.el6.x86_64.rpm
mysql-community-devel-5.7.31-1.el6.x86_64.rpm
mysql-community-libs-compat-5.7.31-1.el6.x86_64.rpm
mysql-community-embedded-5.7.31-1.el6.x86_64.rpm
mysql-community-common-5.7.31-1.el6.x86_64.rpm
mysql-community-server-5.7.31-1.el6.x86_64.rpm
mysql-community-embedded-devel-5.7.31-1.el6.x86_64.rpm
mysql-community-libs-5.7.31-1.el6.x86_64.rpm
mysql-community-client-5.7.31-1.el6.x86_64.rpm
[root@ctpdb1 MY57]# yum install mysql-community-{server,client,common,libs-compat,libs}-* mysql-5.*.
[root@ctpdb1 MY57]# service mysqld start
Starting mysqld: [ OK ]
Now same as upgrade above mysql 5.6 to 5.7 we can upgrade existing mysql 5.7 to mysql 8.0 using rpm.
[root@ctpdb1 MY8.0]# service mysqld stop
[root@ctpdb1 MY8.0]# tar -xvf mysql-8.0.21-1.el6.x86_64.rpm-bundle.tar
[root@ctpdb1 MY8.0]# yum install mysql-community-{server,client,common,libs-compat,libs}-* mysql-8.*.
[root@ctpdb1 MY8.0]# service mysqld start
Please do not forget to share your comment on below comment box.

0 Comments:
Post a Comment