Renaming prefixes of table names within phpmyadmin?

  1. Click/open the database.

  2. Click Structure at the top bar.
    This will display all your tables. Note the existing prefix.

  3. Scroll to the bottom, to the last table.

  4. Click "Check all".
    This will check all tables.

  5. Click the drop down menu just next to it - the one with the default value "with selected".

  6. Select "Replace table prefix:"
    This will bring you to a new page with two text inputs.

  7. Fill in your existing prefix, e.g. "oldPrefi_". Don't forget the underscore.

  8. Fill in your new prefix, e.g. "newPrefi_". Don't forget the underscore.

  9. Finally, click submit.

You will be redirected to the table list with the new prefix.


An easy way is to let the script delete the tables for you. Much faster on large database sites like Joomla or WordPress.

In phpMyAdmin choose Custom output. Under Object Creation Options, check the box to ADD DROP TABLE / .... Export to text or file as usual and open in preferred text editor. You will notice there are two lines for each table now: DROP TABLE IF EXISTS prefix_tablename; and CREATE TABLE IF NOT EXISTS prefix_tablename

Step 1: Search and replace all 'prefix_' with 'theprefixyouwant_' This should now look like:

DROP TABLE IF EXISTS 'theprefixyouwant_'and CREATE TABLE IF NOT EXISTS 'theprefixyouwant_'

Step 2: Search and replace all DROP TABLE IF EXISTS 'theprefixyouwant_' with DROP TABLE IF EXISTS 'prefix_'.

Save. Run / import SQL. Done.

This WILL delete all your original tables without prompting. Make certain you have a safe DB backup on file just in case of emergencies. As with the original solution, do this at your own risk, however I just did it on three small production sites without issue.


Have all the corresponding tables in phpMyadmin ticked and select With Selected..->Replace table prefix