Restore MySQL table

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
TonsOfFun
Forum Commoner
Posts: 54
Joined: Wed Jun 02, 2010 7:37 pm

Restore MySQL table

Post by TonsOfFun »

The table in question seems to have been deleted. When I try to re-create the table I get this error:
[text]#1813 - Tablespace for table '`database`.`table`' exists. Please DISCARD the tablespace before IMPORT. [/text]
Is it possible to restore the old table with the data?
If not, how do I discard the tablespace so I can re-create the table?
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Restore MySQL table

Post by Celauran »

There are a lot of 'depends' in there. Do you have backups? Is the .idb file present and .frm file missing, or vice versa?
TonsOfFun
Forum Commoner
Posts: 54
Joined: Wed Jun 02, 2010 7:37 pm

Re: Restore MySQL table

Post by TonsOfFun »

No backups. Where would I find those files? The site is on shared hosting.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Restore MySQL table

Post by Celauran »

Probably /var/lib/mysql, though cPanel could have changed that to use its own path.
Post Reply