标签:
1. MySQL批量删除指定前缀表
Select CONCAT( ‘drop table ‘, table_name, ‘;‘ )
FROM information_schema.tables
Where table_name LIKE ‘mytaobao_%‘;
执行完上方的sql后将下方的结果copy出来执行一次就会将所有前缀为“mytaobao”的表删除。
2.批量修改表名
Select CONCAT( ‘ALTER TABLE ‘, table_name, ‘ RENAME TO ‘, table_name,‘;‘ )
FROM information_schema.tables
Where table_name LIKE ‘mytaobao_%‘;
执行上方的sql语句,将结果copy到editplus中,Ctrl+H 将RENAME TO mytaobao替换为RENAME TO newtaobao
标签:
原文地址:http://www.cnblogs.com/herowalking/p/5526709.html