Important Notice for New Installations with MySQL 8
Transitioning from MySQL 8.0 to MariaDB 10.11 on a New cPanel & WHM Server
If you’ve recently installed cPanel and it defaulted to MySQL 8, but you wish to switch to MariaDB 10.11, ensure your server is new with no pre-existing databases before proceeding. This change is experimental and not supported officially.
Warning: This migration method is entirely experimental and unsupported. Please refrain from contacting cPanel support for issues related to this guide.
If you initially forgot to set your preferred database in /root/cpanel_profile/cpanel.config
during your recent installations of cPanel & WHM, here’s a guide allowing a seamless switch from the default MySQL to MariaDB 10.11:
Step-by-Step Guide to Migrate from MySQL 8.0 to MariaDB 10.11
As the root user, start by removing MySQL 8.0:
dnf -y remove mysql-community-*
Next, completely remove the MySQL data directory:
rm -rf /var/lib/mysql
Update the desired SQL version in the cPanel configuration:
sed -i 's/mysql-version=8.0/mysql-version=10.11/g' /var/cpanel/cpanel.config
Begin the MariaDB installation with this API command:
whmapi1 start_background_mysql_upgrade version=10.11
To monitor the installation progress:
tail -f /var/cpanel/logs/mysql_upgrade.YYYYMMDD-HHMMSS/unattended_background_upgrade.log
After installation, check the MySQL version to verify the update:
mysql -V
Customizing MySQL or MariaDB Version During Initial cPanel Setup
To set a specific database version during the initial installation of cPanel, follow these steps:
Adjust the RPM Installation Preferences:
echo "mysql-server=mysql-version=10.11" > /etc/cpanel_mysql_installation.profile
Database Version Options:
# For MySQL 8
mysql-version=8.0
# For MariaDB 10.6
mysql-version=10.6
# For MariaDB 10.5
mysql-version=10.5
# For MariaDB 10.11
mysql-version=10.11
cPanel Installation Overview on AlmaLinux
For a detailed walkthrough of installing cPanel on AlmaLinux, refer to cPanel’s official installation guide.
Prerequisites for AlmaLinux 9:
Before installing, ensure your system is updated:
sudo dnf update -y
Update /etc/resolv.conf:
# Google DNS
nameserver 8.8.8.8
nameserver 8.8.4.4
# Cloudflare DNS
nameserver 1.1.1.1
nameserver 1.0.0.1
Then download and run the cPanel installation script:
cd /home
curl -o latest -L https://securedownloads.cpanel.net/latest
sh latest