MySQL-是否可以在一段时间内备份mySQL数据库? [英] MySQL- Is it possible to backup mySQL database within a period of time?
问题描述
我将在一段时间内备份mySQL数据库. 例如:仅备份1月到6月的数据.
I am going to backup mySQL database in a period of time. For example: Only backup the data from January to June.
有可能这样做吗?我要这样做的原因是我不想备份太旧的数据库. 如果可能的话,请给我一些建议. 谢谢.
Is it possible to do that? The reason I want to do this is I don't want to back up the database that is too old. If it is possible please give me some suggestion how to do that. Thanks.
推荐答案
我假设您要基于日期而不是表本身来备份表ROWS.
I am assuming you want to backup table ROWS based on date, not tables themselves.
例如,如果表具有date
或timestamp
列,则可以使用INTO OUTFILE
查询根据日期备份某些行.
If your tables have a date
or timestamp
column, then you can backup certain rows based on date using an INTO OUTFILE
query, for example.
或者,在命令行中,您可以将mysqldump与--where
选项一起使用.
Or, from the command line, you could use mysqldump with the --where
option.
查看此答案: MYSQL仅转储某些行
这篇关于MySQL-是否可以在一段时间内备份mySQL数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!