【问题描述】
由于安装wxbot时,admin_log和msg_log表默认分区只加到了2024年,因此到了2025年后导致数据写入错误。
【解决方案】
修改表结构:
ALTER TABLE `ky_msg_log` #注意表前缀改成你们实际的 ADD PARTITION ( PARTITION p2025 VALUES LESS THAN (2026) ENGINE = InnoDB, PARTITION p2026 VALUES LESS THAN (2027) ENGINE = InnoDB, PARTITION p2027 VALUES LESS THAN (2028) ENGINE = InnoDB, PARTITION p2028 VALUES LESS THAN (2029) ENGINE = InnoDB, PARTITION p2029 VALUES LESS THAN (2030) ENGINE = InnoDB ); ALTER TABLE `ky_admin_log` #注意表前缀改成你们实际的 ADD PARTITION ( PARTITION p2025 VALUES LESS THAN (2026) ENGINE = InnoDB, PARTITION p2026 VALUES LESS THAN (2027) ENGINE = InnoDB, PARTITION p2027 VALUES LESS THAN (2028) ENGINE = InnoDB, PARTITION p2028 VALUES LESS THAN (2029) ENGINE = InnoDB, PARTITION p2029 VALUES LESS THAN (2030) ENGINE = InnoDB );