Merge Two MySQL Databases
Posted by H9 Admin on 20 November 2014 04:57 PM
|
|
The easiest way to achieve merging two MySQL databases is to essentially copy data from a table to another table and back again. Both databases need to exist on the same account. If they do not, you will need to create a backup of one and move it over to the same account as your second database. If both databases have the same name, you will need to also rename one before moving. Once both are on the same account, log in to either SSH or cPanel... cPanel
Shell (SSH)
INSERT INTO myname_oldsaved.responses SELECT * FROM myname_newsaved.responses Tip! Use REPLACE INTO instead of INSERT INTO to have the data from DB2 overwrite the data in DB1 if they share a primary/unique key. | |
|