I got it working. I decided to just disable SSL for the MySQL connection. Not going to lie, didn't know how to do that myself so I asked AI. It gave me a code that disables SSL in the MySQL connection string. It also switched to MySql Connector from MySql.Data since it is better. When running the docker container it suggested using "--add-host=host.docker.internal:host-gateway" and using "host.docker.internal" DNS as the address in the connection string.
Surprisingly it worked really well and also cleared up some confusion I had about how Docker, Linux VMs and MySQL servers work. The error wasn't really solved but this workaround is easy to do and it works in my specific case since my Unity server and MySQL server are on the same VM. I have finally everything set up to start working on the actual game :)