首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >Mysql查看存储过程、函数、视图、触发器、表

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

作者头像
爱喝水的木子
发布于 2022-01-12 09:57:16
发布于 2022-01-12 09:57:16
5.4K0
举报
文章被收录于专栏:爱喝水的木子爱喝水的木子

mysql查看所有存储过程,函数,视图,触发器,表 查询数据库中的存储过程和函数

方法一: 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' //函数

方法二: show procedure status; //存储过程 show function status; //函数

查看存储过程或函数的创建代码

show create procedure proc_name; show create function func_name;

显示数据库的所有存储过程

select name from mysql.proc where db=’数据库名’; mysql> select name from mysql.proc where db = 'py1903';

select routine_name from information_schema.routines where routine_schema='数据库名';

show procedure status where db='数据库名';

SELECT * from information_schema.VIEWS //视图 SELECT * from information_schema.TABLES //表

查看触发器 方法一: 语法:SHOW TRIGGERS [FROM db_name] [LIKE expr] 实例:SHOW TRIGGERS\G //触发器 方法二: 对INFORMATION_SCHEMA数据库中的TRIGGERS表查询 mysql>SELECT * FROM triggers T WHERE trigger_name=”mytrigger” \G

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2019-06-29 ,如有侵权请联系 cloudcommunity@tencent.com 删除
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档