Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to copy a MySQL table with phpMyAdmin

This guide shows you how to make a copy of one table, inside the same database or in another one.

Databases2 min read12 steps6 screenshots

What is a table?

A database is like a filing cabinet. A table is one drawer in it. It holds rows of data, like a spreadsheet. phpMyAdmin is a web tool for managing databases. You can open it from cPanel, your hosting control panel.

Copying a table is a good way to make a safe test version before you change things.

Steps

  1. Log in to your client area. Open your hosting service and log in to cPanel.
    cPanel login page
  2. Under Databases, click phpMyAdmin.
    cPanel phpMyAdmin
  3. On the left, click the database that holds your table.
  4. Click the table you want to copy.
    cPanel databases
    cPanel database tables
  5. At the top, click the Operations tab.
    cPanel operations
  6. Find the box named Copy table to (database.table).
  7. Choose the target database from the list. To copy within the same database, keep the current one.
  8. Type a new table name. It must be different from any table already in that database.
  9. Pick what to copy:
    • Structure only: makes an empty table with the same columns.
    • Structure and data: makes a full copy with all rows.
      cPanel operations details
    • Data only: copies rows into a table that already exists.
  10. Tick Add AUTO_INCREMENT value if the table numbers its rows automatically and you want the counter to carry over.
  11. Leave Switch to copied table unticked if you want to stay on the old table.
  12. Click Go.

A message tells you the table was copied. The new table now appears in the left list.

Warning: If you copy into a name that already exists, you can overwrite data. Always use a new name, or take a backup first.

Copy with SQL

You can also use the SQL tab:

CREATE TABLE new_table LIKE old_table;
INSERT INTO new_table SELECT * FROM old_table;

The first line copies the layout. The second copies all the rows.

Tip: Large tables can time out. If that happens, ask Hostvento support for help.

Quick recap

  • Open phpMyAdmin from cPanel and pick your table.
  • Use the Operations tab and the Copy table to box.
  • Choose structure only, or structure and data.
  • Use a new name, then click Go.