1. Download needed version of MySQL
[paul.f@cd-gf ~]$ wget https://downloads.mysql.com/archives/get/file/mysql-5.7.19-1.el7.x86_64.rpm-bundle.tar
2. Move it to the Destination Server
[paul.f@cd-gf ~]$ scp mysql-5.7.19-1.el7.x86_64.rpm-bundle.tar 10.4.0.15:/home/paul.f/
3. Enter into the Destination Server
[paul.f@cd-gf ~]$ ssh 10.4.0.15
4. Switch as root user
[paul.f@-gf ~]$ sudo -i
5. Check Space Availability
[root@-gf ~]# df -h
6. Stop Slave in MySQL
mysql> stop slave;
7. Stop MySQL Service
[root@-gf paul.f]# systemctl stop mysqld
8. Take Backup of existing my.cnf
[root@-gf paul.f]# cp /etc/my.cnf /etc/my.cnf_11012018
9. Unlink the Symbolic Link
[root@-gf paul.f]# cd /var/lib/
lrwxrwxrwx 1 root root 11 Jan 17 2017 mysql -> /data/mysql
[root@-gf lib]# unlink mysql (where 'mysql' is the name of Symbolic Link)
10. Extract the TAR File
[root@db-gf lib]# cd /home/paul.f/
[root@-gf paul.f]# tar xvf mysql-5.7.19-1.el7.x86_64.rpm-bundle.tar
11. Remove the Unwanted Files
[root@db-gf paul.f]# rm -rvf mysql-5.7.19-1.el7.x86_64.rpm-bundle.tar mysql-community-test-5.7.19-1.el7.x86_64.rpm mysql-community-server-minimal-5.7.19-1.el7.x86_64.rpm mysql-community-minimal-debuginfo-5.7.19-1.el7.x86_64.rpm
12. Grep the Currently Installed RPMs
[root@-gf paul.f]# rpm -qa | grep -i mysql
13. Remove Current Version of MySQL
[root@-gf paul.f]# rpm -e mysql-community-server-5.7.17-1.el7.x86_64 mysql-community-client-5.7.17-1.el7.x86_64 mysql-community-libs-5.7.17-1.el7.x86_64 mysql-community-libs-compat-5.7.17-1.el7.x86_64 mysql-community-common-5.7.17-1.el7.x86_64 mysql-community-devel-5.7.17-1.el7.x86_64 --nodeps
14. Install New Version of MySQL
[root@-gf paul.f]# rpm -ivh mysql-community-*
15. Replace New my.cnf with the Backed Up one
[root@-gf paul.f]# cp /etc/my.cnf_11012018 /etc/my.cnf
16. Remove Old Symbolic Link
[root@db-gf paul.f]# cd /var/lib/
[root@-gf lib]# rm -rvf mysql (where 'mysql' is the name of Symbolic Link)
17. Create a Symbolic Link for /data/mysql
[root@-gf lib]# ln -s /data/mysql .
18. Locate MySQL Service
[root@-gf mysql]# locate mysqld.service
/etc/systemd/system/multi-user.target.wants/mysqld.service
/usr/lib/systemd/system/mysqld.service
19. Grep Open Files Limit from my.cnf
[root@-gf mysql]# cat /etc/my.cnf | grep -i open
20. Replace the Open Files Limit Value taken from my.cnf in mysqld.service
[root@-gf mysql]# vim /usr/lib/systemd/system/mysqld.service
21. Reload the daemon
[root@-gf mysql]# systemctl daemon-reload
22. Start MySQL Service
[root@-gf mysql]# systemctl start mysqld
23. Run MySQL Upgrade
[root@-gf mysql]# mysql_upgrade -s
24. Restart MySQL Service
[root@-gf mysql]# systemctl restart mysqld
25. Check Log for Errors
[root@-gf mysql]# tail -100f errorgf.log
26. Start Slave
mysql> start slave;
27. Remove the RPM Files
[root@-gf paul.f]# rm -rvf mysql-community-*
No comments:
Post a Comment