Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Drop multiple databases?
- John Sherling
December 14, 2006, 2:18 am
rate this thread
pall databases that share a common prefix, using a single command. So
if my databases are:
I'd like to be able to drop them all with something like:
DROP DATABASE user1_*;
Possible? Other ways to do the same thing?
Re: Drop multiple databases?
Not possible, but you could create a script that would first query
tablenames, separate those you want to and create delete queries and
execute them. It isn't that hard if you are working on Linux or similar
platform and are experienced programmer, but if you are talking about
20-50 tables, just do "show tables", copy-paste the result to an text
editor and use search&replace to create delete queries and copy-paste
back to console to execute.
- » Americanas.com SALDO de TVs Com at 80% de Desconto (29798)
- — Newest thread in » MySQL Database Forum