Lets say I have two MySQL databases with some complex table structures. Neither database has the same table name. Lets say these tables contain no rows (they do but I could truncate the tables, the data is not important right now, just testing stuff). Lets say I need these 2 databases merged into one. For instance:
DB1:
cities
states
DB2:
index
subindex
posts
I want to end up with a single DB that contains:
cities
states
index
subindex
posts
Is this possible?
You can use
RENAME TABLEon all the tables from one of the databases.See: http://dev.mysql.com/doc/refman/5.0/en/rename-table.html
Providing there are no duplicates.