msql 清库

SELECT concat('DROP TABLE IF EXISTS ', table_name, ';')
FROM information_schema.tables
WHERE table_schema = 'dr_staging3_plyck';




select concat('DROP PROCEDURE IF EXISTS ', name, ';') 
from mysql.proc where db = 'dr_staging3_plyck' and `type` = 'PROCEDURE' ;

select concat('DROP FUNCTION IF EXISTS ', name, ';') 
from mysql.proc where db = 'dr_staging3_plyck' and `type` = 'FUNCTION' ;
SELECT concat('DROP TABLE IF EXISTS ', table_name, ';')
FROM information_schema.tables
WHERE table_schema = 'mydb';

select `name` from mysql.proc where db = 'your_db_name' and `type` = 'PROCEDURE' ;
select `name` from mysql.proc where db = 'your_db_name' and `type` = 'FUNCTION' ;
select concat('DROP PROCEDURE IF EXISTS ', name, ';') 
from mysql.proc where db = 'dr_staging1_shia' and `type` = 'PROCEDURE' ; select concat('DROP FUNCTION IF EXISTS ', name, ';')
from mysql.proc where db = 'dr_staging1_shia' and `type` = 'FUNCTION' ;
DROP PROCEDURE IF EXISTS PROC_UPR_DZ; DROP FUNCTION IF EXISTS Code_To_Cnm;
原文地址:https://www.cnblogs.com/xiluhua/p/15585099.html