Earlier quoted context omitted.
The database doesn't accept external connections, out of curiosity, what is the proper way to pass connection credentials?
at a minimum: - keep config variables in a separate file that is in your .gitignore and won't get pushed to github. - keep config file outside of any web accessible directory in case the file renders in plaintext for some reason. Regardless of db only accepting local connections - an attacker is one step closer to dumping the db.
Still very valuable things to be aware of in future situations where the above might not apply, thank you very much.