MySQL Forums
Forum List  »  Triggers

Re: Firing an On Insert Trigger from Server A to Server B
Posted by: uwe resch
Date: April 25, 2011 04:43AM

you need 3 tables:

like this:
on server A

CREATE TABLE `dbnam1`.`test` (
`ID` int(11) NOT NULL,
`data` text,
PRIMARY KEY (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

on server B

CREATE TABLE `dbnam2`.`test` (
`ID` int(11) NOT NULL,
`data` text,
PRIMARY KEY (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1



and a second one on server A wich links to the table on server B

CREATE TABLE `testfed` (
`ID` int(11) NOT NULL,
`data` text,
PRIMARY KEY (`ID`)
) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://username2:password456@192.168.5.5:3306/dbnam2/test'

now create your trigger to copy from test to testfed and the data will bi insert into your test table from dbnam 2

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Firing an On Insert Trigger from Server A to Server B
1536
April 25, 2011 04:43AM


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.