找不到的幽灵表
老钱包 2013-08-02 04:40:24 新建立一个测试库
mysql> create database t2;
mysql> use t2;
mysql> create table if not exists testt1(id int(4),content varchar(20));
ERROR 1050 (42S01): Table '`t2`.`testt1`' already exists
结果发生了幽灵表的问题
mysql> create table if not exists testt1(id int(4),content varchar(20));
ERROR 1050 (42S01): Table '`t2`.`testt1`' already exists
mysql> insert into testt1 values(0005,"laugh ge");
ERROR 1146 (42S02): Table 't2.testt1' doesn't exist
mysql> show tables;
Empty set (0.00 sec)
因为之前使用直接删掉数据库文件夹的方式,将这个t2库干掉了。
搜了一下 information_schema 这个库
select * from TABLES where TABLE_SCHEMA='t2' limit 5;
结果是空!
求问这个问题如何处理?