StarDomain

Database Optimization and Repair

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

  1. Go to phpMyAdmin in your control panel
  2. Select your database
  3. Click Check All to select all tables
  4. From the dropdown, choose Optimize table

Optimize via SSH

mysqlcheck -u username -p --optimize database_name

Repair Corrupt Tables

If a table is marked as crashed:

Via phpMyAdmin

Select the table → OperationsRepair table

Via SSH

mysqlcheck -u username -p --repair database_name

WordPress-Specific

  1. Install WP-Optimize plugin
  2. 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