|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi, I have two different database with the same schema.
I want to save some rows from one table of Database A. Then insert these rows into the corresponding table in Database B. What is the best way to do that? Not sure if I can use mysqldump since mysqldump always try to drop the table before you insert the rows. But I need to keep the table in Database B. Thanks! |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Dan wrote:
> Hi, I have two different database with the same schema. > > I want to save some rows from one table of Database A. > > Then insert these rows into the corresponding table in Database B. > What is the best way to do that? > > Not sure if I can use mysqldump since mysqldump always try to drop the > table before you insert > the rows. But I need to keep the table in Database B. Thanks! mysqldump doesn't always try to drop the table. There are options on mysqldump that enable you to produce only the INSERT statements and nothing else. To find the details search for mysqldump in the manual (you know that book that other people go to when they need an answer to a question like this). |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Dan wrote:
> Hi, I have two different database with the same schema. > > I want to save some rows from one table of Database A. > > Then insert these rows into the corresponding table in Database B. > What is the best way to do that? > > Not sure if I can use mysqldump since mysqldump always try to drop the > table before you insert > the rows. But I need to keep the table in Database B. Thanks! > mysql5: insert [ignore] into databaseB ( select * from databaseA ) then, you have to deal with keys if some records are alrerady present in databaseB... |
|
![]() |
| Outils de la discussion | |
|
|