> ## Documentation Index
> Fetch the complete documentation index at: https://help.noxity.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Table Operations

> Repair, optimize, rename, change collation, truncate, and drop tables in phpMyAdmin.

The **Operations** tab on a single table is where the maintenance commands live. Open a table in phpMyAdmin (left tree → database → table), then click **Operations** at the top.

<Frame caption="phpMyAdmin Operations tab with all sections visible">
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/noxity/images/cpanel/database-management/phpmyadmin/table-operations/page-light.png" alt="Operations tab with Move, Rename, Order by, Table options, Copy, Maintenance" className="block dark:hidden" />

  <img src="https://mintlify.s3.us-west-1.amazonaws.com/noxity/images/cpanel/database-management/phpmyadmin/table-operations/page-dark.png" alt="Operations tab with Move, Rename, Order by, Table options, Copy, Maintenance" className="hidden dark:block" />
</Frame>

## Repair a corrupted table

Symptoms: queries error with "table is marked as crashed", the table won't open, or rows are reading back as garbage.

<Steps>
  <Step title="Click Repair table under Maintenance">
    Bottom-right of the Operations page, in the **Table maintenance** group.
  </Step>

  <Step title="Wait">
    For small tables it's instant. For tables with millions of rows it can take a few minutes.
  </Step>

  <Step title="Read the result">
    Successful repair shows `OK` under the **Msg\_text** column. If it doesn't, check the [common issues below](#common-issues).
  </Step>
</Steps>

<Note>
  **InnoDB tables don't need repair.** The engine handles its own crash recovery automatically. The Repair button is a no-op for InnoDB. It's only useful for legacy MyISAM and Aria tables.
</Note>

## Optimize a table

Optimize rebuilds the storage layout, freeing up space left behind by deleted rows. Worth running:

* After a big bulk delete
* On heavily-updated tables once a quarter
* Never on InnoDB unless you're tight on disk space

Click **Optimize table** under Maintenance. It locks the table for the duration, so don't run it on a busy production table during peak hours.

## Rename a table

<Steps>
  <Step title="Find the Rename table to section">
    Top of the Operations page, in the **Table options** column.
  </Step>

  <Step title="Type the new name">
    The new name keeps the database prefix you're already in.
  </Step>

  <Step title="Click Go">
    The rename is atomic for InnoDB. Any application or query referencing the old name will start erroring immediately.
  </Step>
</Steps>

<Warning>
  Renaming a table the live site uses takes the site down until you update the code. Coordinate with deploys, or take a [JetBackup](/web-hosting/cpanel/file-management/jetbackup) snapshot first.
</Warning>

## Change collation

Collation controls how text columns sort and compare, especially for non-ASCII characters. Change the table-level default in **Table options** → **Collation**, then click **Go**.

To change collation on existing columns (not just new ones), tick **Change all column collations** in the same section.

The most common change: legacy WordPress installs on `utf8_general_ci`, moving to `utf8mb4_unicode_ci` for proper emoji support.

## Truncate (empty without dropping)

`TRUNCATE` deletes every row but keeps the table structure. Faster than `DELETE FROM ...` for big tables because it doesn't go row-by-row.

<Steps>
  <Step title="Find Empty the table (TRUNCATE) under Delete data or table">
    Bottom-left of Operations.
  </Step>

  <Step title="Click it and confirm">
    A confirmation dialog appears. Type the table name to confirm.
  </Step>

  <Step title="Wait">
    Truncate is near-instant on most tables. Auto-increment counters reset to the starting value.
  </Step>
</Steps>

<Warning>
  Truncate is irreversible. There's no rollback even inside a transaction (in MySQL, `TRUNCATE` is implicitly committed). Take an [export](/web-hosting/cpanel/database-management/phpmyadmin/export) of the table first.
</Warning>

## Drop a table

Drop removes the table and all its data permanently.

<Steps>
  <Step title="Find Delete the table (DROP)">
    Below Truncate, in the same red-tinted box.
  </Step>

  <Step title="Click and confirm">
    Type the table name to confirm. The table is gone.
  </Step>
</Steps>

<Warning>
  No undo. If it's a production table, take a [JetBackup](/web-hosting/cpanel/file-management/jetbackup) snapshot or a phpMyAdmin export first. The 30-second cost up front is much cheaper than the recovery you'd otherwise be doing.
</Warning>

## Copy a table

Useful for staging changes. Copy `orders` to `orders_backup_20260427`, run your migration on the live `orders`, and you have a fast rollback target.

<Steps>
  <Step title="Find Copy table to under Move/Copy">
    Right side of the Operations page.
  </Step>

  <Step title="Pick database and new name">
    The copy can stay in the same database or land in another. **Same database** + a new name is the common case.
  </Step>

  <Step title="Pick what to copy">
    * **Structure only**: empty copy with the same columns and indexes
    * **Data only**: copy rows into an existing table (rare)
    * **Structure and data**: full copy
  </Step>

  <Step title="Click Go">
    The copy completes. The new table appears in the left tree.
  </Step>
</Steps>

## Common issues

<AccordionGroup>
  <Accordion title="Repair table fails with 'Can't create new tempfile'">
    The table is too large to repair on the available disk space (repair needs to write a temp copy alongside the original). Either increase disk through your plan, or open a ticket and we'll repair it from the server side where we have more headroom.
  </Accordion>

  <Accordion title="Rename fails with 'Errcode: 13 - Permission denied'">
    File-system permissions on the database directory got out of sync, usually after a botched restore. Fixing this needs root access, so open a support ticket.
  </Accordion>

  <Accordion title="Optimize on InnoDB shows 'Table does not support optimize, doing recreate + analyze instead'">
    That's expected. InnoDB doesn't have an in-place optimize, so the engine does a full rebuild plus statistics refresh. Functionally equivalent to optimize, just longer.
  </Accordion>
</AccordionGroup>

## Need a hand?

<CardGroup cols={2}>
  <Card title="Open a ticket" icon="life-ring" href="https://members.noxity.io/submitticket.php">
    Best for anything that needs an account check or a config change on our end.
  </Card>

  <Card title="Live chat" icon="messages" href="https://noxity.io/contact">
    Faster for quick questions during business hours.
  </Card>
</CardGroup>
