Databases

Upgrade MySQL or MariaDB on a cPanel server in WHM (root guide)

Safely upgrade MySQL or MariaDB on cPanel as root with WHM's MySQL/MariaDB Upgrade tool: version choice, backups, compatibility checks, running the upgrade and rollback planning.

AdvancedWHM (root)2 min read

cPanel supports several MySQL and MariaDB versions, and older ones reach end of life. WHM's MySQL/MariaDB Upgrade tool upgrades the database server in place. It is safe when prepared well, but a database upgrade can only be rolled back from backups, so preparation matters.

MdmHost handles this on its hosting plans. This guide is for administrators of their own cPanel VPS or dedicated server with root access.

Before you start

  • Root access to WHM and SSH.
  • A full backup of all databases, made right before the upgrade.
  • A maintenance window and notice to customers.
  • The list of versions your cPanel version supports, shown by the upgrade tool.

Back up all databases

mkdir -p /root/dbbackup; for db in $(mysql -N -e 'show databases' | grep -Ev '^(information_schema|performance_schema|sys)$'); do mysqldump --single-transaction --routines --events "$db" | gzip > /root/dbbackup/$db.sql.gz; done

Also back up /etc/my.cnf. A provider snapshot of the server is an extra safety net.

Check compatibility

  • MySQL to MariaDB is possible; MariaDB back to MySQL is not supported. Choose your direction carefully.
  • Upgrade one major version at a time if the tool requires it.
  • Check applications that use removed features, such as old SQL modes or deprecated authentication plugins.
  • Review custom settings in /etc/my.cnf; some options are renamed or removed in newer versions.

Run the upgrade

  1. Go to WHM → SQL Services → MySQL/MariaDB Upgrade.
  2. Choose the target version and click Next.
  3. Read and acknowledge the warnings about the version change.
  4. Choose the upgrade type: Unattended for most servers.
  5. Click Continue and watch the log. Do not reboot or stop the process.

Warning: Do not interrupt the upgrade. If SSH disconnects, the WHM task keeps running; reopen the page to follow progress.

Verify afterwards

mysql -V; mysqlcheck --all-databases --check-upgrade
  • Load several customer sites, including WordPress and shop sites.
  • Check WHM → SQL Services → Show MySQL Processes for stuck queries.
  • Watch the MySQL error log for warnings during the first hours.

If something goes wrong

Rolling back means reinstalling the old version and restoring the dumps, or restoring a snapshot. That is why the backup step is not optional. Database-level problems on customer sites are covered in mysqldump backup and restore.

On CloudLinux servers, MySQL Governor must match the new version; CloudLinux's documentation describes upgrading through its own tooling (see MySQL Governor). Keep the rest of the server current with Update Preferences.

Frequently asked questions

MySQL or MariaDB?

Both work with cPanel and typical PHP apps. MariaDB is common on hosting servers; choose the version with the longest remaining support that cPanel offers.

How long does an upgrade take?

Usually minutes; large servers with many databases can take longer because tables are checked after the upgrade.

With MySQL Governor installed, which tool do I use?

Use CloudLinux's documented procedure for Governor so its MySQL packages stay in sync.

Will customers' database passwords change?

No. Users, passwords and grants are kept during an in-place upgrade.

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.