문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top