Skip to content

Latest commit

 

History

History
15 lines (10 loc) · 540 Bytes

sql.md

File metadata and controls

15 lines (10 loc) · 540 Bytes

sql

remove databases starting with SomeString:
mysql -u usr -ppswd -h host  -e "show databases" -s | egrep "^SomeString" | xargs -I "@@" echo mysql -h host -u usr -ppswd -e "\"drop database @@\""
can also modify to drop tables:
mysql -u usr -ppswd -h host  -d database -e "show tables" -s | egrep "^SomeString" | xargs -I "@@" echo mysql -h host -u usr -ppswd -d database -e "\"drop table @@\""

reference