Drop multiple databases?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'm using 4.1.13a of mysql. Want to know if there's an easy way to dro
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:


Possible? Other ways to do the same thing?

Many thanks...

Re: Drop multiple databases?


John SherlingE0=EF=E8=F1=E0=E2:
Quoted text here. Click to load it

Re: Drop multiple databases?

John Sherling wrote:
Quoted text here. Click to load it

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.

Site Timeline