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.
You can’t shrink an InnoDB tablespace.
You will have to dump/restore to reclaim the space:
0) dump mysql database
- shut down mysql
- move away any InnoDB data and log files
- 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:
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?