MySQL Forums
Forum List  »  Replication

Re: Binlog for specific databases
Posted by: Partha Dutta
Date: September 25, 2005 11:27AM

Dan Casey wrote:
> I have a few large databases running on my mysql
> server. There is a single bin log that holds all
> information for all databases.
> Is there any way to create a seperate binlog for
> each database? I am running into issues with
> starting replication. One database needs to be set
> to a certain logfile and position, and another
> database has some other logfile and position that
> it is up to.
> So if i get a duplicate entry replication stops
> for all databases rather then just one...
> Is there a way to say this database is up to x
> file and x log pos, and this other database is up
> to y file and y position???
> Is there an alternative?
> mysql 4.0.20 - no, I cannot upgrade yet :(

You can not have separate binary logs per database. But, you can specify statements to be written to the binary log only for specific databases.

You can do this with the parameter binlog-do-db. For example:

binlog-do-db = test
binlog-do-db = world

This would enable binary logging for only statements for those listed databases. Statements would NOT be written if the SQL statement were issued against a database not listed, e.g.:
USE sales; INSERT INTO values ('a','b','c');

For more info, you can refer to

Partha Dutta
Senior Consultant, MySQL Inc.

Options: ReplyQuote

Written By
September 22, 2005 08:20AM
Re: Binlog for specific databases
September 25, 2005 11:27AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.