时间:2021-07-01 10:21:17 帮助过:4人阅读
concat(truncate(sum(index_length)/1024/1024,2),‘MB‘) as index_size
from information_schema.tables
group by TABLE_SCHEMA
order by data_length desc;
查询 表结构
show create tables tablename
查询视图结构
show create view viem.name
查询数据库中的存储过程和函数
select `name` from mysql.proc where db = ‘xx‘ and `type` = ‘PROCEDURE‘ //存储过程
select `name` from mysql.proc where db = ‘xx‘ and `type` = ‘FUNCTION‘ //函数
show procedure status; //存储过程
show function status; //函数
查看存储过程或函数的创建代码
show create procedure proc_name;
show create function func_name;
查看视图
SELECT from information_schema.VIEWS //视图
SELECT from information_schema.TABLES //表
查看触发器
SHOW TRIGGERS [FROM db_name] [LIKE expr]
SELECT * FROM triggers T WHERE trigger_name=”mytrigger” \G
mysql
标签:concat and HERE 函数 procedure 过程 term tab show