Skip to content

RootDBA

DBA expertise: PostgreSQL, SQL Server & MySQL

Menu
  • Home
  • blog
  • PostgreSql
  • MySql
  • Sql Server
  • About AHMED – Root DBA
Menu

Upgrading MySQL Server

Posted on September 2, 2025 by AHMED

Types of MySQL Version Upgrades

there are two types of upgrades

  1. Minor MySQL Version Upgrade
    • Example : upgrade from 8.0.28 to 8.0.30
  2. Major MySQL Version Upgrade
    • Example : upgrade from 5.7 to 8.0

Minor Version Upgrade

The first step when performing a minor version upgrade is to obtain the current version of MySQL and the newer minor upgrade available.

To get the current version of MySQL on Red Hat, we use the following command, which queries the RPM package:

rpm -qa | grep -i percona

8eec0deca2ebfb8c63897b3ac365bdbd.png

To obtain the newer version, we can check the Percona website and see which is the latest version released.

https://www.percona.com/downloads

43e35fd0a99a1d2930c639fd084f0fbc.png

To summarize our current setup, we are running Percona MySQL 8.0.30 and aiming to upgrade it to version 8.0.35

To begin, we will obtain the new version for Percona Server and Percona Server Client from the Percona website. We can directly download the packages using the wget command.

04ad61d1d90b1af4590289e600afec99.png

i will copy the link for download and past it along side wget command to download the package on VM

wget https://downloads.percona.com/downloads/Percona-Server-8.0/Percona-Server-8.0.35-27/binary/redhat/8/x86_64/percona-server-client-8.0.35-27.1.el8.x86_64.rpm?_gl=1*14grt98*_gcl_au*MTA0Mzk1MDYyOS4xNzE1NjkwMzk5

wget  https://downloads.percona.com/downloads/Percona-Server-8.0/Percona-Server-8.0.35-27/binary/redhat/8/x86_64/percona-server-server-8.0.35-27.1.el8.x86_64.rpm?_gl=1*14grt98*_gcl_au*MTA0Mzk1MDYyOS4xNzE1NjkwMzk5

ac852a96690992c1115adf1f0de3bafb.png

the file will be download compressed in at format , we will use command tar -xf [filename] to extract the file

tar -xf percona-server-client-8.0.35-27.1.el8.aarch64.rpm?_gl=1*1p3zum3*_gcl_au*MTA0Mzk1MDYyOS4xNzE1NjkwMzk5


 tar -xf percona-server-server-8.0.35-27.1.el8.x86_64.rpm?_gl=1*14grt98*_gcl_au*MTA0Mzk1MDYyOS4xNzE1NjkwMzk5

next step which is very important is to stop MySQL services

systemctl stop mysqld

systemctl status mysqld

2e15cf99dc394a142f0f7c13555b99aa.png

now we will start installing the package using yum localinstall

sudo yum localinstall percona-server-client-8.0.35-27.1.el8.x86_64.rpm

e61bbfced87a5a8b4c1c50a99bb737c5.png

0be56421b55c11d4eb58f72cb28c8cc3.png

256549cfc9a1916091cb2d09b21feb7e.png

26cb153e66ce8b5915ee8b7cef95f2fe.png

The minor upgrade has completed successfully, and we can now start the MySQL service.


a619e8a36b976dd86e1d343335568296.png

Major MySQL Version Upgrade

reference link
For a MySQL major version upgrade, the process typically involves installing the desired major version first, such as MySQL 5.7, and then performing the upgrade to version 8.

we can use the below script to install MySQL 5.8

PERCONA REPO
sudo yum -y install https://repo.percona.com/yum/percona-release-latest.noarch.rpm
ENABLE 5.7 REPO
sudo percona-release setup ps57
INSTALL MYSQL 5.7
sudo yum -y install Percona-Server-server-57
VERIFY MYSQL 5.7
rpm -qa | grep -i percona
START MYSQL
sudo systemctl start mysqld.service
GRAB ROOT PASSWORD AND RUN SECURE INSTALLATION
grep temp /var/log/mysqld.log
mysql_secure_installation

4e55649cd8b436f30ba3b3275bb8ed07.png

For testing purposes, we’ll replicate the real-world example database on the server to simulate the upgrade in a more realistic manner. You can execute the following command to download the database and then import it into the MySQL server.

wget https://downloads.mysql.com/docs/world-db.tar.gz

tar -xf world-db.tar.gz


cd  world-db/
mysql -uroot -p < world.sql

71f11478d8573168aa36c45954b83574.png

1- MySQL upgrade checklist

first thing we need to confirm that all the data in the database and all tables are in proper format

we can use the mysqlcheck utility

mysqlcheck -uroot -p --all-databases --check-upgrade

19ac81df11b104236c00488101647f7d.png

The command will verify all tables in the database to ensure their compliance with the current version, checking for any errors or inconsistencies.

2- mysqlsh script – Pre-Upgrade Check

There is actually a MySQL script, designed by Oracle, that checks whether the current version is compatible with the MySQL upgrade process.

you can follow the steps in this link You’ll download MySQL Shell and run a script that assesses whether upgrading from the current version to MySQL 8 is feasible.

898c5b1be717d802cb8cc0d1dc79905c.png

mysqlsh is installed and now we will run the script provided by oracle to check upgrade combability

 mysqlsh -- util check-for-server-upgrade root@localhost --target-version=8.0.30 --output-format=JSON --config-path=/etc/my.cnf

The concern is ensuring that the report generated by the script does not contain any errors.
you may receive a warning regarding mysql_native_authenticating which will be deprecated in newer MySQL versions, so keep this in mind and make sure that the MySQLl server you want to upgrade does support mysql_native_sql, otherwise you will have to change the user to authenticate via caching_sha2_password

3- Dumping the Database

It is highly recommended to create a full database dump before you perform any upgrade. This guarantees that you have a backup of your data in case something goes wrong during the upgrade process and you need to restore it.

To create a database dump, you can use the mysqldump utility. Here’s an example command:

mysqldump -u root -p --all-databases > all_databases.sql

This command will create a file named all_databases.sql that contains a dump of all databases on the server.”””

5623aca7c59e12109f1ed5ea647695af.png

Perform MySQL Major Version Upgrade

now we will start by downloading the mysql package
but before that let’s first verify which package are installed
rpm -qa | grep -i percona

669d78c63ec6df915da23be13b575685.png

ac86cce823b395b630b2fa53e60007cb.png

we will download the package first

wget https://downloads.percona.com/downloads/Percona-Server-8.0/Percona-Server-8.0.30-22/binary/redhat/8/x86_64/Percona-Server-8.0.30-22-r7e301439b65-el8-x86_64-bundle.tar?_gl=1*1hchtzx*_gcl_au*MTA0Mzk1MDYyOS4xNzE1NjkwMzk5


tar -xf Percona-Server-8.0.30-22-r7e301439b65-el8-x86_64-bundle.tar?_gl=1*1hchtzx*_gcl_au*MTA0Mzk1MDYyOS4xNzE1NjkwMzk

now stop mysqld services

systemctl stop mysqld

remove MySQL 5.7 from system

 sudo yum remove Percona-Server-shared-compat-57-5.7.44-48.1.el8.x86_64 -y

sudo yum remove Percona-Server-shared-57-5.7.44-48.1.el8.x86_64

Removing ‘shared’ and ‘shared-compat’ will uninstall both the MySQL Server client and the MySQL Server itself.

2f0a3e782079c1ecb1f1db84ad60d8ba.png

now we will install mysql 8 on system

sudo yum localinstall  percona-server-shared-8.0.30-22.1.el8.x86_64.rpm

sudo yum localinstall  percona-server-shared-8.0.30-22.1.el8.x86_64.rpm

sudo yum localinstall percona-icu-data-files-8.0.30-22.1.el8.x86_64.rpm

sudo yum  localinstall percona-server-client-8.0.30-22.1.el8.x86_64.rpm


sudo yum  localinstall percona-server-server-8.0.30-22.1.el8.x86_64.rpm

12f59dd8fb8c4a1b5f144d481ed9f7cf.png

Before initiating the upgrade process, you need to start MySQL with the upgrade option. Upon starting mysqld with the upgrade option, from version shared-8.0.16 onwards, it will conduct a check on all binary and data files, initiating the upgrade process as necessary.

systemctl start mysqld

You can monitor the progress of the upgrade process by checking the log files, which will provide insights into how the upgrade process is proceeding.

sudo cat /var/log/mysqld.log

eef42ac336e8aa6c5a65dde7e3520f93.png

b697238292b80f95d61defd5a817108f.png

0
Visited 4 times, 1 visit(s) today
Category: mysql

Post navigation

← MySQL Server Replication
Mysql Perocna Xtradb Cluster Setup Guide →
© 2025 RootDBA | Powered by Minimalist Blog WordPress Theme