Introduction
It is possible to preconfigure a cPanel installation so that your desired version of MySQL is installed from the start.
Procedure
On a brand new server that does not have cPanel installed, create the following file:
mkdir /root/cpanel_profile
touch /root/cpanel_profile/cpanel.config
You'll then add one of the following example configurations to the file to specify your desired version of MySQL or MariaDB, then run the installer as you normally would.
Current Versions
MySQL 8
mysql-version=8.0
MySQL 5.7
Unavailable on AlmaLinux 8, CloudLinux 8, and CentOS 8
mysql-version=5.7
MariaDB 10.6
mysql-version=10.6
MariaDB 10.5
mysql-version=10.5
MariaDB 10.3
Unavailable on CentOS 8
mysql-version=10.3
EOL Versions - Should Not be Used In Production
The following versions are provided as examples only and should not be used. Attempting to make use of these versions may cause the cPanel installation to fail, which would then require you to reload a fresh operating system and start over from scratch.
MySQL 5.6
mysql-version=5.6
MariaDB 10.0
mysql-version=10.0
MariaDB 10.1
mysql-version=10.1
MariaDB 10.2
mysql-version=10.2