Ultra Web Hosting Docs

Repairing & Optimizing Databases

Over time a busy database can pick up minor corruption or slow down as tables grow. cPanel and phpMyAdmin both include tools to check, repair, and optimize your tables so your site keeps running smoothly.

Symptoms of a Problem

A few common signs point to a database that needs attention:

Repairing from cPanel

cPanel offers the quickest fix for a crashed table:

  1. Log into cPanel and open MySQL Databases.
  2. Scroll to Modify Databases.
  3. Under Repair Database, choose the database and click Repair Database.
  4. To look for problems without fixing them, use Check Database instead, which reports the status of each table.
Note Repair and check operations run on every table in the selected database and usually finish in a few seconds. On very large tables they can take longer — let the process complete rather than reloading the page.

Repairing from phpMyAdmin

phpMyAdmin lets you work on individual tables, which is handy when only one is affected:

  1. Open phpMyAdmin and select the database in the left pane.
  2. In the table list, tick the box beside the table (or tables) you want to work on.
  3. From the With selected drop-down at the bottom, choose Check table, Repair table, or Optimize table.

The same actions are available on a single table under its Operations tab. Optimize table reclaims unused space and can speed up a table that has had many rows deleted.

Tip Run Optimize table occasionally on large, frequently updated tables such as the WordPress wp_options and wp_postmeta tables. It defragments the data and often trims query times.

"MySQL server has gone away"

This error means the connection to MySQL dropped mid-query. Common causes include:

Retrying the operation usually succeeds. If it keeps happening, look for a slow or oversized query, add missing indexes, or split a large import into smaller pieces as described in Importing & Exporting Databases.

When to Contact Support

Open a support ticket if:

Warning Repair and optimize operations modify tables in place. Before running them on an important database, export a backup so you have a clean copy to fall back on.