Mysql 查看视图、存储过程、函数、触发器

查询数据库中的存储过程和函数

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

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容