xcdemon05
xcdemon05

Reputation: 716

Is there a way to actually save a mySQL database to Github?

I've been looking around and all I can find is people managing db scripts using github. So they aren't storing the databases, but a list of all commands performed on a database which is then use to sync up two separate databases.

I'm managing my MySQL database using a number of php pages. Is there some way that I can actually store a real database on github along with my website, such that no matter which box I'm working from I'll be using the same database?

Upvotes: 6

Views: 19905

Answers (2)

Ron
Ron

Reputation: 473

You can also create a git hook which can automatically dump the database.

I use this git hook https://github.com/BlurryFlurry/switchdbwhencheckout for switching the database when I switching branches.

Upvotes: 1

Jerry Ajay
Jerry Ajay

Reputation: 1094

Why not?! You can commit the database directory to git if you want to. Programmers usually share only code on Git, not data.

Anyway, check this link http://www.mkyong.com/mysql/where-does-mysql-stored-the-data-in-my-harddisk/ to get datadir path on your system. Go there and you can find folders for every database that exists on mySQL. Commit the necessary .frm file to git.

Upvotes: 4

Related Questions