--- Narayanamoorthy Srinivasan <[EMAIL PROTECTED]> wrote:

> Hi,
>         I have setup MySQL replication for only one database
> 
> /etc/my.cnf (master server)
>            binlog-do-db=knowledgebase
> 
> /etc/my.cnf (slave server)
>           replicate-do-db=knowledgebase
> 
> I am able to replicate the changes from master to slave, if my
> application uses "use <dbname>" and then insert/delete/update
> statements.
> 
> But if I used insert/delete/update statements directly (ie) "delete
> from dbname.tablename;" (without "use" statement), the changes are
> not
> replicating and also it is not logged in binlog file.

You need the documentation a bit more thoroughly :)

http://dev.mysql.com/doc/refman/4.1/en/binary-log.html

<quote>
 Tell the server to restrict binary logging to updates for which the
default database is db_name (that is, the database selected by USE).
All other databases that are not explicitly mentioned are ignored. If
you use this option, you should ensure that you do updates only in the
default database.

There is an exception to this for CREATE DATABASE, ALTER DATABASE, and
DROP DATABASE statements. The server uses the database named in the
statement (not the default database) to decide whether it should log
the statement.

An example of what does not work as you might expect: If the server is
started with binlog-do-db=sales, and you run USE prices; UPDATE
sales.january SET amount=amount+1000;, this statement is not written
into the binary log. 
</quote>


Mithun

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
linux-india-help mailing list
linux-india-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to