Re: replicate-rewrite-db

2008-04-04 Thread Dan Rogart
On Fri, Apr 4, 2008 at 6:30 AM, Shanmugam, Dhandapani <
[EMAIL PROTECTED]> wrote:

Hi,

Hi,
>
> Any idea wat replicate-rewrite-db does with example..
>
>
>
>
It takes statements for one database, and rewrites them into another.

An example of the syntax would be this line in the my.cnf file of your
slave: replicate-rewrite-db="master_db->master_db_foo"

Any statement on master_db would be replicated to the slave, but then
executed on master_db_foo.

So, for example:  You execute 'update table1 set foo=4 where bar=2;' on the
master_db on your replication master.  The statement would get replicated
down to the replication slave.  When the slave is evaluating your
replication rules, it will see that the statement should be rewritten to
apply to the master_db_foo.  Then 'update table1 set foo=4 where bar=2;' is
executed on master_db_foo.

Hope that helps,

Dan


replicate-rewrite-db

2008-04-04 Thread Shanmugam, Dhandapani
Hi,

Any idea wat replicate-rewrite-db does with example..





Re: --replicate-rewrite-db fails when attempting to drop a table

2006-01-18 Thread Gleb Paharenko
Hello.

You should not use a cross database syntax for you queries. Instead of
'DROP TABLE `livedb`.`test_replication`'
use
use livedb;
DROP TABLE test_replication



Ian wrote:
> Hi List,
> 
> I have been asked to setup replication between two customers servers for one 
> particular 
> database, which I will call in this post 'livedb'.
> 
> The customer also has a copy of this database on the slave which they use for 
> testing. 
> This copy does not contains the same data as the master and the customer 
> wants to 
> leave it this way, they therefore asked if it was possible to replicate to a 
> different database 
> name, e.g. livedb_backup.
> 
> I suggested the use of the --replicate-rewrite-db option.
> 
> When I set this up and tested it I decided to create a new table and then 
> drop it to make 
> sure it was working ok ( if it wasn't I didn't want to taint the existing 
> data ).
> 
> I created a table called test_replication and it was promptly created on the 
> slave, but, 
> when I issued a DROP TABLE command the replication stopped and the follwing 
> error 
> was present in the .err file:
> 
> 060117 15:25:22 Slave: Error 'Unknown table 'test_replication'' on query. 
> Default 
> database: 'livedb_backup'. Query: 'DROP TABLE `livedb`.`test_replication`', 
> Error_code: 
> 1051
> 
> Both servers are Windows running version 4.0.26 ( one is win2k the other 
> win2k3 ).
> 
> Am I doing something wrong or is this a bug?
> 
> Here is the relevant section of my.ini on the slave:
> 
> --->8-
> [mysqld]
> basedir=D:/mysql
> datadir=D:/mysql/data
> 
> set-variable=max_connections=300
> 
> log-bin
> server-id=20
> 
> log-error
> log-slow-queries
> log-slave-updates
> log-warnings
> 
> replicate-do-db=livedb_backup
> replicate-rewrite-db=livedb->livedb_backup
> --->8-
> 
> 
> Thanks
> 
> Ian


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
   <___/   www.mysql.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



--replicate-rewrite-db fails when attempting to drop a table

2006-01-17 Thread Ian
Hi List,

I have been asked to setup replication between two customers servers for one 
particular 
database, which I will call in this post 'livedb'.

The customer also has a copy of this database on the slave which they use for 
testing. 
This copy does not contains the same data as the master and the customer wants 
to 
leave it this way, they therefore asked if it was possible to replicate to a 
different database 
name, e.g. livedb_backup.

I suggested the use of the --replicate-rewrite-db option.

When I set this up and tested it I decided to create a new table and then drop 
it to make 
sure it was working ok ( if it wasn't I didn't want to taint the existing data 
).

I created a table called test_replication and it was promptly created on the 
slave, but, 
when I issued a DROP TABLE command the replication stopped and the follwing 
error 
was present in the .err file:

060117 15:25:22 Slave: Error 'Unknown table 'test_replication'' on query. 
Default 
database: 'livedb_backup'. Query: 'DROP TABLE `livedb`.`test_replication`', 
Error_code: 
1051

Both servers are Windows running version 4.0.26 ( one is win2k the other win2k3 
).

Am I doing something wrong or is this a bug?

Here is the relevant section of my.ini on the slave:

--->8-
[mysqld]
basedir=D:/mysql
datadir=D:/mysql/data

set-variable=max_connections=300

log-bin
server-id=20

log-error
log-slow-queries
log-slave-updates
log-warnings

replicate-do-db=livedb_backup
replicate-rewrite-db=livedb->livedb_backup
--->8-


Thanks

Ian
-- 


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



replicate-rewrite-db

2003-02-19 Thread Arthur Kerpician
I have the same db on master and slave and I want to use
replicate-rewrite-db to change the replicating name of this db on the
slave.

Slave my.cnf:
---
[mysqld]
datadir=/var/lib/mysql
socket=/tmp/mysql.sock
master-host=master.company.com
master-user=repl
master-password=
master-port=3306
server-id=2
replicate-rewrite-db=mydb->slave_mydb
skip-innodb

[client]
socket=/tmp/mysql.sock

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid


Master my.cnf
---
[mysqld]
log-bin
server-id=1
socket=/tmp/mysql.sock

[client]
socket=/tmp/mysql.sock

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

The slave seems to ignore replicate-rewrite-db option and tries to
create an already existing db (as I said, same db names on master and
slave), so I get an
ERROR 1007: Can't create database 'mydb'. Database exists

I put the replicate-rewrite-db option AFTER creating mydb on master, so
the bin log already contains this action. Can this be the problem?

Thanks,
Arthur


-
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




re: syntax problem with replicate-rewrite-db

2002-11-20 Thread Victoria Reznichenko
David,
Tuesday, November 19, 2002, 5:20:23 PM, you wrote:

DN> (sorry if this is a duplicate -- I don't think the original made it)

DN> Running mysql 3.23.53-max binary on a RedHat 7.2 based server.  Replication
DN> is working fine, but I'm running into errors with the replicate-rewrite-db
DN> directive.  Here's a snippet from my my.cnf file on the slave:

DN> master-port     = 3306
DN> replicate-rewrite-db=mysql->master_mysql

DN> When I try to start the instance, I get the following error in my
DN> log:

DN> 021118 14:30:56  mysqld started
DN> Bad syntax in replicate-rewrite-db - missing '->'!
DN> 021118 14:30:56  mysqld ended

DN> I've tried every possible combination of white space I could think of, and 
DN> even cut and pasted the exact syntax from the documentation, and created
DN> tables with those names, yet I still get the same error, so it doesn't appear
DN> to be a problem specifically with replicating the mysql table.

DN> I've also tried mysql 3.23.52-max binary, and gotten the same thing, so
DN> it's definitely not a issue with a specific version of mysql...

DN> Can anyone help figure out how to get this working?  Anyone else using it?

Hm .. It works fine for me on my test replication (both servers are
3.23.53).



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   <___/   www.mysql.com





-
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




syntax problem with replicate-rewrite-db

2002-11-19 Thread David Nedved
Hi All,

(sorry if this is a duplicate -- I don't think the original made it)

Running mysql 3.23.53-max binary on a RedHat 7.2 based server.  Replication
is working fine, but I'm running into errors with the replicate-rewrite-db
directive.  Here's a snippet from my my.cnf file on the slave:

master-port = 3306
replicate-rewrite-db=mysql->master_mysql

When I try to start the instance, I get the following error in my
log:

021118 14:30:56  mysqld started
Bad syntax in replicate-rewrite-db - missing '->'!
021118 14:30:56  mysqld ended

I've tried every possible combination of white space I could think of, and 
even cut and pasted the exact syntax from the documentation, and created
tables with those names, yet I still get the same error, so it doesn't appear
to be a problem specifically with replicating the mysql table.

I've also tried mysql 3.23.52-max binary, and gotten the same thing, so
it's definitely not a issue with a specific version of mysql...

Can anyone help figure out how to get this working?  Anyone else using it?

Thanks in advance,

David

-
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




syntax problem with replicate-rewrite-db

2002-11-18 Thread David Nedved
Hi All,

Running mysql 3.23.52-max binary on a RedHat 7.2 based server.  Replication
is working fine, but I'm running into errors with the replicate-rewrite-db
directive.  Here's a snippet from my my.cnf file on the slave:

master-port     = 3306
replicate-rewrite-db=mysql->master_mysql

When I try to start the instance, I get the following error in my
log:

021118 14:30:56  mysqld started
Bad syntax in replicate-rewrite-db - missing '->'!
021118 14:30:56  mysqld ended

I've tried every possible combination of spaces I could think of, and I've
even cut and pasted the exact syntax from the documentation, and created
tables with those names, yet I still get the same error, so it doesn't appear
to be a problem specifically with replicating the mysql table.

Can anyone help figure out how to get this working?

Please copy me directly on any responses, as the list management software
is presently ignoring all my attempts to subscribe.

Thanks in advance,

David

-
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




replicate-rewrite-db

2002-02-28 Thread David Cumming

Hello (Post 2)

Has anyone got replicate-rewrite-db (a my.cnf entry) to work. I have replication 
running fine, however the rewrite doesn't work.

I just want to know whether I should persist or if there is something special people 
had to do to get it working. I have heard / read a few people saying that they 
couldn't get it to work.

Mysql :: replication :: rewrite


David Cumming
Webmaster
Corporate Affairs
Environmental Protection Agency
+61 7 3247 3274

www.env.qld.gov.au


-
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




replicate-rewrite-db

2002-02-25 Thread David Cumming

Hello
Has anyone got replicate-rewrite-db (a my.cnf entry) to work. I have replication 
running fine, however the rewrite doesn't work.

I just want to know whether I should persist or if there is something special people 
had to do to get it working. I have heard / read a few people saying that they 
couldn't get it to work.

Mysql :: replication :: rewrite

David Cumming
Webmaster
Corporate Affairs
Environmental Protection Agency
+61 7 3247 3274

www.env.qld.gov.au


-
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