Error:tablespace for table ' database '. ' Temp ' exists. Please DISCARD the tablespace before IMPORT. Workaround

Source: Internet
Author: User

Today, working on the MySQL database table on Navicat, suddenly no response. The MySQL service is also terminated after the restart. Then start the service, check the table, find a table card is gone, add a table again. Reported a mistake:

Error:tablespace for table ' database '. ' Temp ' exists. Please DISCARD the tablespace before IMPORT.

But show databases looked at the moment there is no this watch AH. The online search for a long time did not find a similar situation, took several hours.

Finally, a solution was found as follows:

1. Close all MySQL operations and stop the MySQL service.

2. Locate the database file under the installation directory, under the Data folder in your installation directory, and then open the folder of your corresponding database name. Locate the file that corresponds to the table, and then delete the damaged file.

The file name in the database should be corresponding to your table name one by one, a table, two files, a data file, a log file, in addition to this there is a "db.opt" file do not delete. Other garbled files, and the original files you have gone wrong are all deleted.

3, after the restart of the MySQL service, re-add the same name of the table can be added successfully.

Error:tablespace for table ' database '. ' Temp ' exists. Please DISCARD the tablespace before IMPORT. Workaround

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.