mySQL daily backup from one table to another

后端 未结 2 1197
有刺的猬
有刺的猬 2021-01-28 16:10

If I have 2 tables with the same definition, how would I backup data from it daily? Can I use mySQL Administrator to perform something like this

  • At 12:00am everyda
2条回答
  •  不要未来只要你来
    2021-01-28 16:59

    Yes, you can definitely do that. Have a look at this page: http://dev.mysql.com/doc/refman/5.0/en/batch-mode.html

    If you write your script carefully, so that you are not dropping the table and just inserting the new rows you need not worry about losing the data. If you are having a timestamp stored for each row in the table, that makes things a lot easier. You can use the timestamp to load/update the new rows which have been changed or added since the last batch run.

    However, its always a best practice to make a backup of the current table before you do the insertion. You can cleanup the backup tables, if the import is successful.

提交回复
热议问题