Having carefully and painfully manually populated/manipulated a series of records in a table, I want to retain them for reuse. As the table is rewritten daily I'd like to save JUST these particul开发者_C百科ar records as a series of "inserts". The only way I know how to do this is to dump the whole table as sql using a GUI eg sqlyog.
But is there any quicker/better way to do this?
would mysqldump help ? (it's not a GUI)
edit : note that you can save only part of a table using this tool. since it's command line, you can automate the task easily.
Create a copy of your table with a meaningful name and copy using a INSERT the records your interested in.
Doing it this way gives the most flexibility should you need to copy them back/compare them.
Providing you still have your clean manually populated table available. Copy it into another table:
CREATE TABLE mytable_backup SELECT * FROM mytable;
Then you can re-introduce these to your daily rebuild table using a similar method:
INSERT INTO mytable SELECT * FROM mytable_backup;
Does this help?
精彩评论