Stefan
Stefan

Reputation: 21

Is it safe and recommended to upload SQL to public git repository?

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.

Upvotes: 1

Views: 1394

Answers (2)

ceejayoz
ceejayoz

Reputation: 180176

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.

Upvotes: 4

mariodiniz
mariodiniz

Reputation: 102

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.

Upvotes: -1

Related Questions