472,143 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,143 software developers and data experts.

version control for mysql database

Hi,

That's my first time to send mail to this address for asking help.
Sorry for my poor english firstly.

My case is like this:
Many guys are using a mysql database, each guy has a database copy in
his own PC, they need to do some changes in their local database from
time to time. then all guys need submit the changes to the central
database for sharing.

Is there a good tool or good way to do version control of a database?
I'm thinking a very stupid way whicy is by mysqldump, but I suspect it
maybe will lost data in some special cases.

The stupid mysqldump idea is: I can use mysqldump to dump local
database to a txt file, then using subversion to do version control of
the txt file. After changing local database, each guy can run mysqldump
to dump his local database to a txt file, then commit it to a central
dump file repository, also they need update local dump file from
central dump file repository to get somebody else's changes. then they
can restore local database by updated dump file.

Maybe you will ask me why don't let all guys to share a central
database, the reason is it seems like very hard to do security control,
because all guys need to change same table in same database(only
different records), our current application does not have any security
control for the database. on the other hand, to do version control of
database, we can record all guy's change in an easy way, and we can
arrange a manager to review changing patch, it seems like a better way.

Another small question is : if two guys add some different records at
the same time, those different records will have same primary key(which
is INTEGER auto-incremented), althrough I can merge those new added
records into one file and try to restore all of them to database, but,
database will claim "duplicate id" error. So I'm thinking if there is a
switch which can control mysql to change the duplicated id to a
auto-incremented value and insert it to database automatically?

Thanks in advance!

Sep 29 '06 #1
0 5671

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Campbell's List | last post: by
12 posts views Thread by lawpoop | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.