xinhoshinou this is not related to Flarum but server management. Although there are quite a few (dev)ops in this community, with their help you might be able to get going but I don't think it's smart to try to install your own server if you don't know how to maintain it going forward. Server management is a continuous task, not a fire and forget thing.
Aside from that, the .my.cnf doesn't exist for the root user yet and it might not even be necessary. I can imagine the tutorial you are following (which you didn't link, so I'm at a loss why this command is even needed) asks you to set the root password in this file, but many operating systems nowadays allows root to access mysql regardless. So if the next command would have been something related to a binary mysql
you should be able to execute it regardless.