Since I had some problems with my database, I tried to drop the database. When that didn't work, I removed my database folder in C:/xampp/mysql/data. I used SHOW TABLES
and it said no tables in my database.
Now the problem is, first time importing my database dump file, I got the following problem:
ERROR 1050 (42S01) at line 2990: Table '`db`.`tbl`' already exists
I tried removing the table with the following query:
DROP TABLE tbl;
This gives the following error:
ERROR 1051 (42S02): Unknown table 'db.tbl'
However, I tried to create it with the following query:
CREATE TABLE tbl (id int NOT NULL PRIMARY KEY);
MySQL gives the following error:
ERROR 1813 (HY000): Tablespace for table '`db`.`tbl`' exists. Please DISCARD the tablespace before IMPORT.
I tried looking it up but I can't figure it out. Removing the .idb file causes the same problem eventually, I can't run ALTER TABLE tbl DISCARD TABLESPACE;
because it'll give the error the table db.tbl
doesn't exist.
Is there a way to fix this and what is the cause of it? I got these errors out of nowhere and it's frustrating