My guru, Ken, has warned me about sharing my.cnf settings because they need to be personalized for every different server. However, I will at least share my my.cnf file, which is working on my MariaDB 10.2.31 Moodle 3.9 system. Be careful to not treat my settings as "the best." In my my.cnf file, you will see that I tried to highlight where all these settings came from. Fine-tuning a database seems to be somewhat of an art, and not a science. Well, here's my file.
If you find any of my settings to be incorrect, I would like to know. (Thanks.)