It is possible to preconfigure a cPanel installation so that your desired version of MySQL is installed from the start.
On a brand new server that does not have cPanel installed, create the following file:
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.
Unavailable on AlmaLinux 8, CloudLinux 8, and CentOS 8
Unavailable on CentOS 8
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.