title: MySQL table(space) exists but can't discard
body: <p>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 <code>SHOW TABLES</code> and it said no tables in my database.</p>
  
  <p>Now the problem is, first time importing my database dump file, I got the following problem:</p>
  
  <pre><code> ERROR 1050 (42S01) at line 2990: Table '`db`.`tbl`' already exists
  </code></pre>
  
  <p>I tried removing the table with the following query:</p>
  
  <pre><code>DROP TABLE tbl;
  </code></pre>
  
  <p>This gives the following error:</p>
  
  <pre><code>ERROR 1051 (42S02): Unknown table 'db.tbl'
  </code></pre>
  
  <p>However, I tried to create it with the following query:</p>
  
  <pre><code>CREATE TABLE tbl (id int NOT NULL PRIMARY KEY);
  </code></pre>
  
  <p>MySQL gives the following error:</p>
  
  <pre><code>ERROR 1813 (HY000): Tablespace for table '`db`.`tbl`' exists. Please DISCARD the tablespace before IMPORT.
  </code></pre>
  
  <p>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 <code>ALTER TABLE tbl DISCARD TABLESPACE;</code> because it'll give the error the table <code>db.tbl</code> doesn't exist.</p>
  
  <p>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</p>