There is a simple task: when adding a new row to a table of one database, insert the same row into the table of another database.
A query was written: ...
delimiter // create trigger test after insert on bd1.test1 for each row begin insert into bd2.test2 set test2.first_1 = NEW.test1.first_1; set test2.second_1 = NEW.test1.second_1; set test2.third_1 = NEW.test1.third_1; end//
... but then error 1046 (no db selected) occurs. If before the column names to clarify the base in which they are located, the system swears at the unexpected point.
Tell me how to implement the necessary request? @