
例表:t_table,表中无数据。
生产环境下( MySQL )这个表一切正常,我本地环境下( MariaDB 10.4.10-MariaDB-log )都出现好几次表无缘无故消失不见(只剩 .ibd 文件,.frm 文件消失了)。
表结构如下:
CREATE TABLE `t_table` ( `id` char(36) NOT NULL, `assem_ref` varchar(20) NOT NULL, `as_id` char(36) NOT NULL, `goods_id` char(36) NOT NULL, `period` varchar(20) NOT NULL DEFAULT '', `in_date` date DEFAULT NULL, `in_pici` varchar(20) NOT NULL, `in_count` int(20) unsigned NOT NULL, `in_count_total` int(20) unsigned NOT NULL, `cost_price` decimal(18,2) NOT NULL DEFAULT '0.00', `cost_material` decimal(18,2) unsigned NOT NULL, `cost_labor` decimal(18,2) unsigned NOT NULL, `cost_prod` decimal(18,2) unsigned NOT NULL', `input_user_id` char(36) NOT NULL, `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `update_time` datetime DEFAULT NULL, `cost_fuli` decimal(18,2) NOT NULL DEFAULT '0.00', `cost_power` decimal(18,2) NOT NULL DEFAULT '0.00', `cost_low_value` decimal(18,2) NOT NULL DEFAULT '0.00', `cost_house` decimal(18,2) NOT NULL DEFAULT '0.00', `cost_depr` decimal(18,2) NOT NULL DEFAULT '0.00', `cost_leasing` decimal(18,2) NOT NULL, `cost_soft` decimal(18,2) NOT NULL DEFAULT '0.00', `cost_dev` decimal(18,2) NOT NULL DEFAULT '0.00', `cost_init_material` decimal(18,2) NOT NULL DEFAULT '0.00', PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; 当用 drop table t_table 时,提示:Unknown table 't_table',但是在数据目录下还有 t_table.ibd 文件存在,对应的 .ifm 消失了。
删除 t_table.ibd 文件后,重新建表时又提示:Table 't_table' already exists,t_table.ibd 文件自动恢复了、、
大家有遇到这种情况吗?求解是什么导致的,因为只有这一张表隔三差五出现这个问题。
1 westoy 2021 年 9 月 11 日 你硬盘有可能要不行了 |
2 singerll 2021 年 9 月 11 日 via Android mysql 的系统表是有这个 bug,动不动看不到。 |
4 gBurnX 2021 年 9 月 12 日 1.OS ? 2.OS version ? 3.MariaDB version ? 4.SELinux 关闭没? 5.MariaDB 安装方式? 6.MariaDB 安装时有没有指派特殊账号? 7.MariaDB 数据目录的权限 对于 MariaDB 服务的进程的账号,有没有限制? 8.有没有监控 MariaDB 所有的 SQL,从里面提取"DROP TABLE"关键字? 9.有没有联合监控 SQL 与.frm 文件,在.frm 消失时,最近 10 秒内的 SQL ? 如果还不行,万不得已就只能走非常麻烦的带源码调试了,这种方式的麻烦程度接近于反汇编,虽然一定能找到结果,但巨麻烦。 |
5 lolizeppelin 2021 年 9 月 22 日 看 change log 中 bug 修复有没有相关的 用官方稳定版. 10.4 的是 10.4.21 |