MySQL 5.5.46 strange error: Table does not exist and can not be created.
Please, can anyone help?
drop table t_example;
Returns: drop table t_example Error Code: 1051. Unknown table 't_example' 0.000 sec
CREATE TABLE t_example(
`id_example` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`des_example` VARCHAR(45) NOT NULL,
`id_example` int unsigned NULL,
PRIMARY KEY (`id_example`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_general_ci;
Returns: Error Code: 1050. Table 't_example' already exists
select * from t_example;
Returns: Error Code: 1146. Table 't_example' doesn't exist
I'm using:
- UBUNTU 14.04 LTS;
- mysql Ver 14.14 Distrib 5.5.46, for debian-linux-gnu (x86_64) using readline 6.
- I'm using root user.
Tried:
mysql> REPAIR TABLE t_example;
+----------------+--------+----------+--------------------------------------+
| Table | Op | Msg_type | Msg_text |
+ ---------------+--------+----------+--------------------------------------+
| mydb.t_example | repair | Error | Table 'mydb.t_example' doesn't exist |
| mydb.t_example | repair | status | Operation failed |
+----------------+--------+----------+--------------------------------------+
2 rows in set (0.00 sec)
Tried too: sudo mysqladmin flush-tables
... Also not solved the problem!
REAL EXAMPLE:
mysql> use flexible;
Database changed
mysql> select * from st_fin_centro_custo;
ERROR 1146 (42S02): Table 'flexible.st_fin_centro_custo' doesn't exist
mysql> CREATE TABLE st_fin_centro_custo(
-> `cod_centro_custo` INT UNSIGNED NOT NULL AUTO_INCREMENT,
-> `des_centro_custo` VARCHAR(45) NOT NULL,
-> PRIMARY KEY (`cod_centro_custo`))
-> ENGINE = InnoDB
-> DEFAULT CHARACTER SET = utf8
-> COLLATE = utf8_general_ci;
ERROR 1050 (42S01): Table '`flexible`.`st_fin_centro_custo`' already exists
mysql> drop table st_fin_centro_custo;
ERROR 1051 (42S02): Unknown table 'st_fin_centro_custo'
mysql>
Tried get from MySQL information_schema:
mysql> SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_TYPE
FROM information_schema.tables
where table_name like 'st_fin_centro_custo';
Empty set (0.00 sec)
mysql>
Note: creating the table with another name works fine.
Thanks a lot!