D
D
Den Alex Smith2015-10-14 19:53:44
MySQL
Den Alex Smith, 2015-10-14 19:53:44

How to drop all tables named `type` from several hundred MySQL databases with the same prefix in one command?

DROP TABLE is apparently not for such operations?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ruslan Fedoseev, 2015-10-14
@netcrox

uuu... one command is unlikely, but you can build the pipeline
for i in `mysql -e -pxxx -u user "show database prefix%"`; do mysql -e -pxxx -u user $i "drop table type"; done
something like this, implementation details are possible

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question