首页 > 代码库 > mysql 日志表rename 备份

mysql 日志表rename 备份

  1. 按照原历史表新增一个新表(空表):

   mysql> show create table history_log\G

  mysql> create table history_log_new ...;

      2. 给历史表重命名,并将新表重命名为历史表:

  mysql> RENAME TABLE history_log to history_log_bak_20151217, history_log_new to history_log;

mysql 日志表rename 备份