Hi. Disclaimer: I am not actively using replication currently, so take it with a grain of salt.
On Mon, May 20, 2002 at 08:15:59PM -0500, [EMAIL PROTECTED] wrote: > I think I understand how to set up replication but have a couple unanswered > questions. I'm hoping the list can help. > > I have two servers with MySQL. Each server currently has completely > different databases, except for the standard mysql permissions database. > Server 1 is in production and server 2 is basically a development box. I > would like to replicate server 1's databases to server 2 (in effect, > creating a hot-swap), but then that would mean that server 2 not only has > the production db's, but also the development db's. My question are: > > 1) Is that even possible to do? Can a slave to a master also have > additional db's on it that the master doesn't even know about? Sure. The master knows almost nothing about the slaves. Just assure that the additional databases/tables have no naming conflicts with those on the master. > 2) If the answer to question one is yes, then what do you do regarding the > mysql permissions db on the slave? Whatever fits best in your situation. You probably want to exclude it from replication and set it up by hand. Normally the privilege tables do not change that often. > BTW, I'm thinking that my setup perhaps has to be more along the following > lines: > > The master contains all my db's, both production and development. The > production db's (as well as the development db's) would sit there in > production on server 1, replicating all the data to server 2. I would have > to set the permissions for both production and development db's on server 1. > > Meanwhile, as the production server is sitting there and replicating all > it's important data to the development box, I could still work on the > development db's on the slave box (thereby not fooling around with the > production box). This is asking for trouble. If you change the dev db on the slave and then the dev db on the master (even only to apply the changes you made on the slave), it will try to propagate the changes to a modified slave which will cause replication will fail pretty soon. Of course, you can handle this by explicitly stopping the replication for the dev db, changing the master, deleting the dev db on slave and then re-syncing them from the master. But do you really want to do this every time and do you really remember to do it every time? > The issue, as I see it, would be that the slave box's development db's would > soon go out of synch with the development db's on the master (because I'd be > inserting, updating, etc. records on the development db's on the slave and > the master would never know). Correct. > I could set up two-way replication, but since I don't really care > about the development db's being in synch on the master, why bother. > Does this make sense? See above. If you do not care about the development dbs on the master, do not put them thereto at first. You have a far better chance to get the privilege tables syncing correctly from the master to the slave. If you set it up reasonably, the updates for the master tables won't affect the privileges for the dev tables on the slave. On the other hand, that makes only sense at all, if the access restrictions for the slave would be the same as for the master, which shouldn't be the case (as the master should be more strict than the dev machine usually). > Anyway, I hope I've made this clear enough for someone to jump with > answers and comments. Yes :-) Bye, Philemon. -- [EMAIL PROTECTED] --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php