The ibdata1 file is the InnoDB system tablespace used by MariaDB/MySQL. On shared hosting, you cannot shrink this file directly since it requires server-level access. However, there are steps you can take to manage your database size and reduce unnecessary InnoDB bloat.
You cannot shrink ibdata1 directly, but you can optimize your databases
On shared hosting, the ibdata1 file is managed at the server level. What you can do is optimize your individual databases to reclaim space within them. If your account is hitting disk space limits due to database size, contact support and we can investigate.
01. What Is ibdata1?
The ibdata1 file stores InnoDB table data, indexes, undo logs, and other internal structures. It grows as your databases grow, but by default it does not shrink when you delete data. This is a known characteristic of the InnoDB storage engine. Even after deleting tables or rows, the space inside ibdata1 is marked as reusable but the file itself does not get smaller on disk.
02. What You Can Do on Shared Hosting
Optimize your tables
In phpMyAdmin, select your database, check all tables, and choose "Optimize table" from the dropdown. This reclaims unused space within the tables themselves:
OPTIMIZE TABLE table_name;
Or optimize all tables at once:
mysqlcheck -u dbuser -p --optimize dbname
Clean up unnecessary data
- WordPress - Delete post revisions, spam comments, transient options, and orphaned metadata. Plugins like WP-Optimize can automate this.
- Clear application caches - Many CMS platforms store cache data in the database that can be safely purged.
- Remove unused tables - Uninstalled plugins sometimes leave their tables behind. Drop them if you are certain the plugin is gone for good.
Contact support
If your database disk usage seems disproportionately large compared to the actual data, open a ticket. We can check the InnoDB configuration and help identify what is consuming space.
03. VPS/Dedicated: Shrinking ibdata1
If you manage your own VPS or dedicated server, shrinking ibdata1 requires exporting all databases, stopping MySQL, deleting the file, reconfiguring InnoDB to use file-per-table mode, restarting MySQL, and re-importing. This is a complex procedure:
- Enable innodb_file_per_table in my.cnf (stores each table in its own .ibd file instead of ibdata1)
- Export all databases with mysqldump
- Stop MySQL
- Delete ibdata1, ib_logfile0, ib_logfile1
- Start MySQL (it recreates a minimal ibdata1)
- Re-import all databases
This procedure involves stopping the database server and deleting data files. One mistake can result in total data loss. Always have verified backups before attempting this. If you are not confident with this process, contact us for assistance.
For database backup methods, see How to Backup a MySQL Database.
Database Taking Too Much Space?
If your database usage seems high, open a ticket and we will help identify what is consuming space and how to reduce it.
Open a Support TicketFrequently Asked Questions
What is the ibdata1 file?
ibdata1 is the InnoDB system tablespace for MariaDB/MySQL, where InnoDB stores data and metadata. It only grows and never shrinks on its own, so it can look large over time. On shared hosting you cannot shrink it directly because that needs server-level access.
Can I shrink ibdata1 on shared hosting?
Not directly, since it requires stopping the database and server-level access you do not have on a shared account. What you can do is reduce database bloat: optimize tables, remove unused data, and drop old databases, which limits further ibdata1 growth.
How do I reduce database bloat on shared hosting?
Optimize your tables in phpMyAdmin, delete unneeded rows and old logs, remove databases you no longer use, and keep applications tidy (for example clearing spam and post revisions in WordPress). This keeps InnoDB from expanding ibdata1 unnecessarily.
How do I actually shrink ibdata1 on a VPS or dedicated server?
With root access you can shrink it by enabling innodb_file_per_table, dumping all databases, stopping MySQL, deleting the ibdata1 and ib_logfile files, and reimporting so each table gets its own file. This is a server-level operation, so back up everything first.
Quick Recap
- ibdata1 grows but does not shrink automatically - InnoDB design
- Shared hosting: optimize tables and clean up unnecessary data
- Use WP-Optimize for WordPress database cleanup
- VPS: full export/delete/reimport procedure required to shrink the file
- Enable innodb_file_per_table to prevent future bloat on VPS
Database management · Last updated November 2026 · Browse all PHP/MySQL articles
