MySQL Upgrade from 8.0.4 to 8.4.x (RHEL) Internet

This article describes the steps, checks, and dependencies required to upgrade MySQL from version 8.0.4 to 8.4.x on RHEL 8 systems. It covers prerequisites, pre-upgrade tasks, upgrade execution, post-upgrade validations, and rollback procedures to ensure a safe and reliable production upgrade.

Prerequisites

OS Compatibility

  • Verify that the operating system supports MySQL 8.4.

  • Recommended: RHEL 8.x or later.

  • Check the OS version:

    cat /etc/os-release

System Requirements

  • Ensure sufficient disk space for backup and rollback (df -Th).

  • Confirm root or sudo access.

  • All listed commands must be executed.

Pre-Upgrade Checks

Backup

  • Perform a logical backup of the MySQL database.

  • Log Management Procedure

  • Confirm you are backing up the correct schema.

    mkdir /home/ec2-user/mysql_backup  
    mysqldump -u root -p ovaledgedb > /home/ec2-user/mysql_backup/ovaledgedb_backup.sql

Ensure sufficient space is available before running the mysqldump command.

  • Back up configuration files:

    sudo cp /etc/my.cnf /home/ec2-user/mysql_backup/  
    sudo cp -a /var/lib/mysql /home/ec2-user/mysql_backup/

Database Size and Row Count Check

  • Run the following queries before upgrading:

    Database size query:

    SELECT 
        table_schema AS "Database Name", 
        ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) AS "DB Size (MB)"
    FROM information_schema.tables 
    GROUP BY table_schema;

    Row count query: (Download SQL script)

  • Save outputs for post-upgrade comparison.

Upgrade Execution

Stop MySQL Services

Stop MySQL services by running the following command

mysql --version  
sudo systemctl stop mysqld

Install MySQL 8.4.x

  • Download repository package:

    wget https://dev.mysql.com/get/mysql84-community-release-el8-1.noarch.rpm
  • Install repository:

    sudo yum localinstall mysql84-community-release-el8-1.noarch.rpm
  • Disable any existing MySQL 8.0 repositories:

    sudo vi /etc/yum.repos.d/mysql-community.repo
    # enable=0 (disable) / enable=1 (enabled)
  • Disable MySQL module in the package manager:

    sudo yum module disable mysql -y
  • Install MySQL 8.4.x:

    sudo yum install mysql-community-server
  • Check installed version:

    mysql --version

Update Configuration

  • Edit the configuration file:

    sudo vi /etc/my.cnf
    mysql_native_password=ON
  • Save file and restart MySQL:

    sudo systemctl restart mysqld  
    sudo systemctl status mysqld
  • Verify upgrade by checking MySQL version.

Post-Upgrade Validations

Verify Row Counts and Database Size

  • Connect to MySQL:

    mysql -u root -p
  • Run validation queries:

    • Row count query: SQL Script

    • Database size query:

      SELECT 
          table_schema AS "Database Name", 
          ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) AS "DB Size (MB)"
      FROM information_schema.tables 
      GROUP BY table_schema;
  • Compare results with pre-upgrade outputs.

Update MySQL Parameters

  • Add/update parameters in /etc/my.cnf:

    max_binlog_size=1GB
    binlog_expire_logs_seconds=2592000
    group_concat_max_len=50000
    max_connections=600
    innodb_buffer_pool_size=10GB
    max_allowed_packet=1G
    bind-address=0.0.0.0
  • Adjust values as per client instance size.

  • Restart MySQL:

    sudo systemctl restart mysqld

Update Application User Passwords (Optional)

  • Change OvalEdge MySQL user passwords:

    ALTER USER 'ovaledge'@'localhost' IDENTIFIED BY '<Password>';  
    ALTER USER 'ovaledge'@'%' IDENTIFIED BY '<Password>';  
    FLUSH PRIVILEGES;

At this stage, the MySQL database has been upgraded to version 8.4 and the default OvalEdge MySQL password has been changed.

Rollback Plan (if required)

  • Take backup of MySQL 8.4 installation before rollback:

    mkdir /home/ec2-user/mysql8.4_backup  
    sudo cp /etc/my.cnf /home/ec2-user/mysql8.4_backup  
    sudo cp -a /var/lib/mysql /home/ec2-user/mysql8.4_backup
  • Stop MySQL services, reinstall MySQL 8.0.4, start the service, and restore data from backups.


Copyright © 2025, OvalEdge LLC, Peachtree Corners, GA, USA.

Last updated

Was this helpful?