MySql 删除相同前缀的表名

SELECT 
  CONCAT('drop table ', table_name, ';') 
FROM
  information_schema.tables 
WHERE table_name LIKE '表前缀%' 
  AND table_schema = '表空间名' 

  批量修改表名:

SELECT 
  CONCAT(
    'ALTER TABLE ',
    table_name,
    ' RENAME TO ',
    table_name,
    ';'
  ) 
FROM
  information_schema.tables 
WHERE table_name LIKE 't_ci_%' ;

  

原文地址:https://www.cnblogs.com/sallet/p/5067236.html