Database Optimization and Repair
Keep your MySQL databases fast and healthy.
Why Optimize?
Over time, databases accumulate overhead from deleted rows, fragmented indexes, and unused data. This slows down your website.
Optimize via phpMyAdmin
- Go to phpMyAdmin in your control panel
- Select your database
- Click Check All to select all tables
- From the dropdown, choose Optimize table
Optimize via SSH
mysqlcheck -u username -p --optimize database_nameRepair Corrupt Tables
If a table is marked as crashed:
Via phpMyAdmin
Select the table → Operations → Repair table
Via SSH
mysqlcheck -u username -p --repair database_nameWordPress-Specific
- Install WP-Optimize plugin
- Schedule automatic cleanups:
- Remove post revisions
- Clean auto-drafts
- Delete spam comments
- Optimize tables
Performance Tips
- Index frequently queried columns
- Remove unused plugins (they often create tables)
- Keep database under 1GB for shared hosting
- Use query caching when available
- Schedule weekly optimization via cron