Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a production webserver with a MySQL database setup as Master. I have a dev server with MySQL setup as Slave, with the data successfully being replicated from the Master.

What happens when a developer commits a chance to the Slave db? Is that commit going to screw up the whole setup?

If this is not the ideal situation for a Production / Dev / Staging setup, what would the ideal setup be?

share|improve this question
up vote 2 down vote accepted

What happens when a developer commits a chance to the Slave db? Is that commit going to screw up the whole setup?

If you're committing to the same database that's being replicated then yes, it will most certainly screw things up.

You ought to have a completely different database that your developers can work against. If you want it to be refreshed periodically from production data, that would be fairly easy to set up and automate.

share|improve this answer
So what is the ideal way of dealing with this issue in a Prod/Dev env? – Josh Brower Jul 13 '11 at 18:50
@Josh - see my edit. Your developers need a separate database instance. You're crazy and asking for trouble if you have them working directly against the production database. – EEAA Jul 13 '11 at 18:52
I have no doubt that I am crazy... :) Though technically, they would be working against a copy of the prod db, not the actual prod db. – Josh Brower Jul 13 '11 at 18:57
As they work against the prod replica, though, it will gradually get further and further out of sync with production and you'll never really know what state the db is in. Doing what you want to do is just a bad practice all around. Don't do it. – EEAA Jul 13 '11 at 19:00
You can use mysqldump to make the backups and then restore them with the mysql command. I would actually recommend setting up a dev environment for each developer on their local computer and then have a shared test/QA environment. That way they can mess up their own data without affecting everyone else. :-) – Scott Keck-Warren Jul 13 '11 at 19:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.