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:
[mysqld]
...
bin-log
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 test.foo values ('a','b','c');
For more info, you can refer to
http://dev.mysql.com/doc/mysql/en/binary-log.html
Partha Dutta
Senior Consultant, MySQL Inc.
http://www.mysql.com