注:有風險需謹慎仔細查看導出表
上述 phabricator_開頭的都不是我想要的需要篩選出來到文件中 /tmp/table.txt
1. 執行sql語句 mysql> select concat('drop database ',TABLE_SCHEMA,';') from( select distinct TABLE_SCHEMA FROM information_schema.tables WHERE TABLE_SCHEMA LIKE 'phabricator_%' )t INTO OUTFILE '/tmp/table.txt';
2.如果碰到ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement,然後在MySQL配置文件裏面[mysqld] 加入 secure-file-priv = ""
3.確認刪除是否是自己想要刪除的
4. mysql> source /tmp/table.txt;