Solved

merging 2 mysql databases with java

Posted on 2016-07-15
7
62 Views
Last Modified: 2016-07-29
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
Comment
Question by:jazzIIIlove
  • 4
  • 3
7 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 41713247
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
 
LVL 12

Author Comment

by:jazzIIIlove
ID: 41725070
Hi,

But any approach you suggest?

Br.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 41725089
You need to issue a series of queries for each and every table
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 12

Author Comment

by:jazzIIIlove
ID: 41725251
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 41725420
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
 
LVL 12

Author Comment

by:jazzIIIlove
ID: 41726628
Do you think my above order is correct?
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 41726652
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question