How to Edit or Delete Database Tables in phpMyAdmin Print

  • 0

phpMyAdmin lets you view and change the data inside your database directly. It's useful when you can't reach your app's admin area, for example to correct a WordPress site address. Changes take effect immediately and there's no undo, so export a copy of the database before you start.

Browse and edit a row

  1. Log in to cPanel and go to Databases › phpMyAdmin.
  2. In the left-hand list, expand your database and click the table you want, for example wp_options in WordPress.
  3. The Browse tab shows the rows. Find the row you need (use Search if the table is large).
  4. Click Edit on that row.
  5. Change the value and click Go to save.

Example: if a WordPress site redirects to an old address, browse wp_options and edit the siteurl and home rows to https://example.co.uk. Your table prefix may differ from wp_; check $table_prefix in wp-config.php.

Delete a row

  1. Browse the table and tick the row (or rows) you want to remove.
  2. Click Delete and confirm.

Empty or delete a whole table

  1. Select the database, so the list of tables appears.
  2. Tick the table, then from the With selected menu choose:
    • Empty to remove every row but keep the table, or
    • Drop to delete the table and all its data completely.
  3. phpMyAdmin asks you to confirm. Check the table name carefully and click Yes.

You can also do this from a table's Operations tab, under Delete data or table.

Good to know

  • Dropping a table that your app still uses will break the site. Only drop tables you know are left over, such as those from a plugin you've removed.
  • Editing serialised values (long strings starting with a: or s:) by hand can corrupt them. Use the app's own settings, or a search-and-replace tool built for the app, instead.
  • If something goes wrong and you have no copy, our daily backups are kept for 7 days; see what backups we keep.

Was this answer helpful?

« Back