"Let's say that I can't change the owner of the files from root to nobody. How could I avoid world-readable files that could potentially compromise the security of the database?"
Can you change the group-onwership of the file?
If so, you can take the "world readable" off the files, and
instead make them group-readable and change the group-ownership of the files to the group that the webserver-user is in.
Note: running as user "nobody" is not a good idea for a webserver.
2nd Note: Files that are accessible by a webserver should never EVER be owned by root.