Reputation: 28184
I truncated several huge tables, but the mysql file and database appears to remain at the same size.
Does truncate table delete the data from mysql as well?
Upvotes: 6
Views: 8018
Reputation: 11
In Version 5.1.55 size was not reduced after Truncate , even with innodb_file_per_table='ON'. So need to DROP and then CREATE the table and then Size was reduced.
Upvotes: 1
Reputation: 7199
When a large table is deleted or truncated InnoDB storage engine for MySQL will leave the empty space, and use it for subsequent insertion of new row versions.
There are ways to shrink database. Check Re: how to shrink a MySQL database
Upvotes: 6