I am assuming MySQL is the database - Are the databases on the same server? If not check this:
http://dev.mysql.com/doc/refman/5.0/en/replication.html
Actually, for all I know you may be able to replicate on the same server but I don't know for sure although I suspect that you can't.
Or you run all your scripts twice against all database functions, one for each database.