我在AWS RDS上有一个MySQL架构,其中有一个表在show tables;
命令的输出中列出,但是使用desc <tableName>;
命令查看表结构时会抛出错误。我已经查询了该表的所有引用的元数据,也找不到。
奇怪的是,我们已经设置了mysql变量lower_case_table_names=1
,但是这个特定的表是用表名中的大写名称创建的。除非可以在我不知道的会话上进行设置。
显示表的输出;
desc的输出/错误消息;
以下查询元数据中表名称的命令将返回零结果。
select * from information_schema.COLUMNS where TABLE_NAME like '%tempPartInfo%';
select * from information_schema.COLUMN_PRIVILEGES where TABLE_NAME like '%tempPartInfo%';
select * from information_schema.FILES where TABLE_NAME like '%tempPartInfo%';
select * from information_schema.KEY_COLUMN_USAGE where TABLE_NAME like '%tempPartInfo%';
select * from information_schema.KEY_COLUMN_USAGE where REFERENCED_TABLE_NAME like '%tempPartInfo%';
select * from information_schema.PARTITIONS where TABLE_NAME like '%tempPartInfo%';
select * from information_schema.REFERENTIAL_CONSTRAINTS where TABLE_NAME like '%tempPartInfo%';
select * from information_schema.REFERENTIAL_CONSTRAINTS where REFERENCED_TABLE_NAME like '%tempPartInfo%';
select * from information_schema.STATISTICS where TABLE_NAME like '%tempPartInfo%';
select * from information_schema.TABLES where TABLE_NAME like '%tempPartInfo%';
select * from information_schema.TABLE_CONSTRAINTS where TABLE_NAME like '%tempPartInfo%';
select * from information_schema.TABLE_PRIVILEGES where TABLE_NAME like '%tempPartInfo%';
select * from information_schema.VIEWS where TABLE_NAME like '%tempPartInfo%';
select * from information_schema.INNODB_CMP_PER_INDEX where table_name like '%tempPartInfo%';
select * from information_schema.INNODB_BUFFER_PAGE_LRU where TABLE_NAME like '%tempPartInfo%';
select * from information_schema.INNODB_CMP_PER_INDEX_RESET where table_name like '%tempPartInfo%';
select * from information_schema.INNODB_BUFFER_PAGE where TABLE_NAME like '%tempPartInfo%';
此表上任何转储整个模式的尝试均会失败。并使用相同的错误消息SQL Error (1051): Unknown table 'v*******r.temppartinfo'
,任何删除该表的尝试也会失败。
由于我在较早的备份中具有表结构,因此不确定在何时该表已损坏。
感谢您为删除此表格提供的任何帮助。
答案 0 :(得分:0)
我发现解决此问题的唯一方法是将除损坏的表以外的整个架构导出到新架构中。