Hi,
We ran into this same (or similar) problem a good while ago, see RT 5.0.1 initialize-database fails on Ubuntu 20 LTS - #2 by rtshouldberewritten. Instead of patching the code here and there to make mysql8 work, we switched to mariadb. We started off with v10.5 and now run on v10.7. No code adaptations were needed.