The best way to accomplish this would be with triggers. I haven't tested this, but it gives you the idea.
DELIMITER $$
CREATE
TRIGGER table_a_after_insert AFTER INSERT
ON database_a.table_a
FOR EACH ROW BEGIN
-- update to match columns in your table
INSERT INTO database_b.table_b (
id,
name
)
VALUES (
NEW.id,
NEW.name
);
END$$
CREATE
TRIGGER table_a_after_update AFTER UPDATE
ON database_a.table_a
FOR EACH ROW BEGIN
DECLARE updated_rows INT;
-- again update the column list to match your table
UPDATE database_b.table_b
SET
name = NEW.name
WHERE id = NEW.id;
-- in case the row didn't already exist in table_b, insert it
SET @updated_rows = ROW_COUNT();
IF updated_rows = 0
THEN
INSERT INTO database_b.table_b (
id,
name
)
VALUES (
NEW.id,
NEW.name
);
END IF;
END$$
CREATE
TRIGGER table_a_after_delete AFTER DELETE
ON database_a.table_a
FOR EACH ROW BEGIN
-- obviously update the column list to match the columns in your table
DELETE FROM database_b.table_b
WHERE id = OLD.id;
END$$
You'll have to make sure the user has the right privileges to database_b.table_b