As a programmer, there are no real problems but challenges...ones that we need to overcome. This means that there is a solution for all challenges that one may face. For all the challenges that I have faced, I will share them and their solutions.
Wednesday, June 4, 2014
Removing tables from database with a particular prefix
use the statement below to get a list of tables. you can then copy the statement and execute it. if there are alot of tables, you may have to repeat the process as often as needed.
SELECT CONCAT( 'DROP TABLE ', GROUP_CONCAT(table_name) , ';' )
AS statement FROM information_schema.tables
WHERE table_schema = 'database_name' AND table_name LIKE 'myprefix_%';
replace 'database_name' with the name of your database and 'myprefix_' with the prefix that you want to delete.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment