0

I need to delete a prefix like this one in a database r8oi9_ which was made by mistake. (not keeping the original prefix while restoring the website)

I want to completely wipe anything with this prefix and not touch other prefixes in the same database. I followed the answer posted in that question: SQL: deleting tables with prefix but there was a warning saying:

/!\ This table does not contain a unique column. Grid edit, checkbox, Edit, Copy and Delete features are not available.

This is the code I used into SQL:

> SELECT CONCAT(  'DROP TABLE ', GROUP_CONCAT( table_name ) ,  ';' )
AS statement FROM information_schema.tables
WHERE table_name LIKE'r8oi9_%';

maybe there is something I am missing, as inserting the name of the database someplace? executing the generated script? Where do I see this script to execute it?

ps.I am an ignorant as it comes to MSQL. Apologies if questions are silly.

Community
  • 1
  • 1
Yannis Dran
  • 1,479
  • 2
  • 18
  • 24

1 Answers1

0

The solution is quite simple, in front of my eyes. However, I did it by hand and not with script which would be better and faster.. So, I clicked the corresponding database's name and then the a screen view like this appeared to me (with "Structure" tab selected) enter image description here

so I checked all boxes corresponding to r8oi9_ prefix carefully not to check the prefixes I wanted to keep (i.e. the prefix mdl_ as the picture above shows). Then I chose the "DROP" choice from dropdown menu saying "With Selected:". Then confirming the drop, I wiped all tables I didn't need. A script instead of this would be much more useful for really large databases.

Yannis Dran
  • 1,479
  • 2
  • 18
  • 24