mysql查询进程、生成删除进程的命令

1、查看所有进程

show processlist;

2、所有进程查询生成杀掉进程的命令

select concat('KILL ',id,';') from information_schema.processlist WHERE time >100;

3、查询数据库所有表名和注释生成添加语句

SELECT  concat('ALTER TABLE ',tableName,'COMMENT=',"'" ,tableComment,"'")  FROM (
SELECT
	TABLE_NAME AS tableName,
	TABLE_COMMENT AS tableComment 
FROM
	information_schema.`TABLES` 
WHERE
	TABLE_SCHEMA = 'digital_potal') t

 

posted @ 2022-08-04 19:12  码奴生来只知道前进~  阅读(230)  评论(0)    收藏  举报