# ibdata file size

**URL:** <https://forums.percona.com/t/ibdata-file-size/1476>\
**Category:** Other MySQL® Questions\
**Created:** [August 12, 2010, 11:14am UTC](https://forums.percona.com/t/ibdata-file-size/1476 "2010-08-12T11:14:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gjuan](https://avatars.discourse-cdn.com/v4/letter/g/53a042/32.png) [@gjuan](https://forums.percona.com/u/gjuan)\
**Post date:** [August 12, 2010, 11:14am UTC](https://forums.percona.com/t/ibdata-file-size/1476/1 "2010-08-12T11:14:31Z")

</div>

I have a ibdata file and i have 3 databases. In one of them i had tables with size around 10 GB, each one.

Now i made a truncate for both tables but the space in the ibdata file never shrinks.

I ran a optimize table, alter table and the ibdata size looks the same.

How can i shrinks ibdata file without make a dump a restore again?

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![justin.swanhart](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/justin.swanhart/32/16904_2.png) [@justin.swanhart](https://forums.percona.com/u/justin.swanhart)\
**Post date:** [August 12, 2010, 11:29am UTC](https://forums.percona.com/t/ibdata-file-size/1476/2 "2010-08-12T11:29:12Z")

</div>

You can’t shrink an InnoDB tablespace.

You will have to dump/restore to reclaim the space:  
0) dump mysql database

1. shut down mysql
2. move away any InnoDB data and log files
3. start mysql and import database

If you want to reclaim space on drop/truncate in the future, then you will need to use --innodb-file-per-table:  
[http://dev.mysql.com/doc/refman/5.1/en/multiple-tablespaces](http://dev.mysql.com/doc/refman/5.1/en/multiple-tablespaces). html

–Swany

---

<div class="post-metadata">

**Author:** ![gjuan](https://avatars.discourse-cdn.com/v4/letter/g/53a042/32.png) [@gjuan](https://forums.percona.com/u/gjuan)\
**Post date:** [August 12, 2010, 3:17pm UTC](https://forums.percona.com/t/ibdata-file-size/1476/3 "2010-08-12T15:17:37Z")

</div>

Hi Justin,

Thanks for your answer.

is this issue considered as a bug? Why the space is not eliminated?

the only solution is to apply the steps that you give me?. Other alternative?

Thanks,
