是否安全并建议将SQL上传到公共git存储库?
Question above. Technically, things should be fine as long as the website is secured well enough, but still, as a newcomer to git, I feel like it would make it just easier for somebody to compromise my server.
EDIT: By that I mean things like create-statements. The issue is about sharing the table structure of my database with everyone.
上面的问题。 从技术上讲,只要网站安全得足够好,事情应该没问题,但是,作为git的新手,我觉得这样会让人更容易损害我的服务器。 p> div>
I think that depends on the project. If it's a personal (study, something smaller or without importance) or open-source, i think it's OK. If you are uploading some company stuff or something that might cause some danger to the application, don't upload in a public repository, but you can upload to git anyway.
This would be a case of "security by obscurity". You should treat your table structure (not its contents, obviously) as public knowledge. You should also be taking care to avoid SQL injection, so knowledge of the table structure isn't abusable.
If it were insecure to know the table structure, every open source project with a DB would be insecure. I can figure out Wikipedia's MySQL structure in a few minutes, but I can't hack Wikipedia because of it.