MySQL Forums
Forum List  »  InnoDB

Re: Database size increased when I delete huge data
Posted by: Peter Brawley
Date: November 02, 2017 11:11AM

The InnoDB tablespace files (ibdata*) are designed to reuse space, so there's not a simple way to reclaim space--you can't just remove a data file from system tablespace. To shrink tablespace file size ...

1. Dump all InnoDB tables with mysqldump.

2. Stop MySQL server.

3. Move all existing tablespace files (ibdata*, iblog*), and all .frm files for InnoDB tables, from the data folder to a safe place.

4. Configure a new tablespace, or set innodb_file_per_table=1 so that you henceforward have direct control over file size.

5. Restart MySQL server.

6. Import the dump files.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Database size increased when I delete huge data
1077
November 02, 2017 11:11AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.