Although I usually consider any move from Ubuntu to anything else as “an upgrade”, moving to CentOS 7 in 2023 is not an upgrade, it’s just stupid.
Both CentOS 7 Linux and CentOS 8 Stream reached end of life and entered the maintenance updates period in the 31st of December 2021. That’s two years ago.
CentOS 7 maintenance updates will END in less than an year. (30th of June 2024).
So why would anyone in 2023 be installing a legacy relic is simply something I can’t understand. But sure for whose coming from Ubuntu anything seems nice.
In the EL family you have much more interesting options, all already in the EL9 branch, like:
AlmaLinux (from CloudLinux, the company behind cPanel, the #1 hosting manager software in the world. this is my favourite distro for web servers)
RockyLinux (from the creators of CentOS Linux, that parted away when Red Hat made the shitty move of moving CentOS to be an upstream distro)
Oracle Linux (my main choice when it comes to database servers and some other app specific)
Red Hat Enterprise Linux (I believe it dispenses introductions, and now has up to 16 production self-service licenses)
About the my.cnf and regarding the database values, the mysql version is ancient.
For all purposes, a production system should have the DB and the web server separate.
Those values need analysis to know if they’re right, which includes how much memory is being used for other processes, but I would suggest you use the mysqltuner script to check on the recommendations for your system.