MySQL: Dropping table with specific table prefix from the Database using Terminal
0
votes
1
answer
95
views
I am trying to delete database tables from PhpMyAdmin using a Terminal (Guake Terminal) with a specific table prefix. I am trying to delete tables with the prefix **wordpress2_** at the beginning of it.
These are the format of the codes I used but it seems like it is not working. Could you possibly help me with this?
mysql -B DatabaseName -u DatabaseUser -pDatabasePassword -e "SELECT CONCAT('DROP TABLE ', TABLE_SCHEMA, '.', TABLE_NAME, ';') FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE 'wordpress2_%' AND TABLE_SCHEMA = 'DatabaseName';"
Thank you very much and your help is highly appreciated.
Asked by SkyCross12
(1 rep)
Feb 8, 2023, 04:06 AM
Last activity: Feb 8, 2023, 05:13 AM
Last activity: Feb 8, 2023, 05:13 AM