An easy way is to let the script delete the tables for you. Much faster on large database sites such as Joomla or WordPress.
In phpMyAdmin, select Custom Output. In the "Object creation options" section, check the "ADD DROP TABLE" / "..." checkbox. Export to text or file as usual and open in your preferred text editor. You will notice that now there are two rows for each table: DROP TABLE IF EXISTS prefix_tablename; and CREATE TABLE IF NOT EXISTS prefix_tablename
Step 1: Find and replace all "prefix_" with "theprefixyouwant_". Now it looks like this:
DROP TABLE IF EXISTS 'theprefixyouwant_' and CREATE TABLE IF NOT EXISTS 'theprefixyouwant_'
Step 2: Find and replace all DROP TABLE IF EXISTS 'theprefixyouwant_' with DROP TABLE IF EXISTS 'prefix_' .
Save. Run / import SQL. Done.
This will delete all source tables without query. Make sure that you have a secure database backup on file only in case of emergency. As with the original solution, do it at your own peril and risk, however I just did it at three small production sites without problems.
source share