Frage

Am having a table with hundreds of record. Now i want to restore a file for the table. I want to add those data in to the table without deleting the existing data. For my knowledge if i restore a table dumb it will delete the old record and add new records. How to avoid this. Otherwise again i want to add those hundreds of records into table after restore that dumb.

Help me to save my time. Thanks in Advance.

War es hilfreich?

Lösung

Edit the table dump first few line which includes Drop Table and create table commands..

Then your dump contains only the insert command and run it with no worry.

Andere Tipps

The mysql dump solution where Drop and Create are removed will not work as the Insert statement does not include the column titles. You'd need to do a mysqldump then edit the file to remove Drop and Create as you say but also change the Insert from just Insert into table values ('a','b',etc) to Insert into table (orgincola,origcolb,etc) values('a','b',etc) Otherwise your data could end up in the wrong columns. This is assuming the structures are not identical in the databases you are combining

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top