This guide explains how to safely upgrade MariaDB on a CloudLinux server using MySQL Governor, with an optional backup step beforehand.
📦 Step 1: Backup MySQL/MariaDB Data (Optional but Recommended)
Before performing any upgrade, back up your current database data directory:
rsync -vrplogDtH /var/lib/mysql /home/MYSQL-BACKUP/
🔐 Note: Make sure no active writes are happening to MySQL during the backup for consistency. Ideally, stop MySQL before this step if you’re doing a full backup:
systemctl stop mysql rsync -vrplogDtH /var/lib/mysql /home/MYSQL-BACKUP/ systemctl start mysql
🛠 Step 2: Install MySQL Governor
MySQL Governor is required for managing and upgrading MariaDB under CloudLinux:
yum install governor-mysql -y
🔄 Step 3: Select MariaDB Version to Upgrade To
Replace mariadb10 with the desired MariaDB version (e.g., mariadb106, mariadb107, mariadb110, etc.).
/usr/share/lve/dbgovernor/db-select-mysql --mysql-version=mariadb10
✅ You can run
db-select-mysql --helpto see all available versions.
🚀 Step 4: Install/Upgrade MariaDB
Run the upgrade using:
/usr/share/lve/dbgovernor/mysqlgovernor.py --install
This command will download and install the required MariaDB packages and migrate your system automatically.
🔁 Step 5: Restart MySQL Service
Once the upgrade is complete:
systemctl restart mysql
🧪 Step 6: Verify the Upgrade
Check the MariaDB version:
mysql -V
Also log into MySQL and check the server version:
mysql
SELECT VERSION();
✅ Optional: Rebuild PHP via EA4 if Needed
If you use EasyApache 4, it may be necessary to rebuild PHP after upgrading MariaDB:
/usr/local/cpanel/scripts/easyapache --build
🧯 Troubleshooting
If you encounter issues:
- Check logs:
/var/log/mysqld.log/var/log/mysql/error.log
- Check for failed package installations:
yum history
📌 Notes
- This guide assumes you are using CloudLinux 8 or 9.
- MySQL Governor helps ensure proper resource usage and tight integration with LVE/CageFS.
