• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 103
  • Last Modified:

merging 2 mysql databases with java

Hi,

I need to merge 2 mysql databases with java or python.

The databases are exactly the same in schema but data is different.

in terms of the query which i need to pass in java or python. Anything i should care about?

Would it be the case that i need to insert data to the table having foreign key first?

what is the strategy?

Br.
0
jazzIIIlove
Asked:
jazzIIIlove
  • 4
  • 3
1 Solution
 
CEHJCommented:
This expert suggested creating a Gigs project.
I don't think there's a 'simple' way to do it. It's just a question of putting the work in
0
 
jazzIIIloveAuthor Commented:
Hi,

But any approach you suggest?

Br.
0
 
CEHJCommented:
You need to issue a series of queries for each and every table
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
jazzIIIloveAuthor Commented:
Should i do this e.g
A) Table 2 fk (source): insert into Table 2' fk (target)

B) Table 1 pk (source): insert into Table 1' pk (target)

Should i do in this order (A, B)

Fk: foreign key, Pk: primary key

Prime tables are the tables that will have the merged data
0
 
CEHJCommented:
Foreign keys would be a consideration if you are going to get referential integrity violations, yes. In that case, you need to do them in an order that doesn't cause violations
0
 
jazzIIIloveAuthor Commented:
Do you think my above order is correct?
0
 
CEHJCommented:
I'm not sure if i understand your notation but the general principle is that the table with a foreign key must be done after the table to which it refers (i.e. the one that contains that key)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now