X
X
xeops2014-12-19 20:14:36
MySQL
xeops, 2014-12-19 20:14:36

How to import multiple related tables in MySQL?

There are two databases with the same structure. Each of them has ≈15 related tables. It is necessary to combine them into one, while maintaining the links between the records in the tables. If you import table by table, then the auto-increment fields will get new values, and the links between tables will be destroyed. Is there a tool or a way how to do an import while maintaining relationships between tables?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
ldv, 2014-12-19
@ldvldv

You can try like this. In one of the source databases, increase the ID values ​​by 1000000000 and the key values, respectively, too (this is if there is no ON UPDATE CASCADE). Import with iD values ​​so that they are not generated on insertion. After import, set AUTO_INCREMENT value for tables.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question