当前位置:Gxlcms > 数据库问题 > Mysql查看存储过程、函数、视图、触发器、表

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

时间:2021-07-01 10:21:17 帮助过:22人阅读

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

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

标签:存储过程、函数   trigger   show   like   status   proc   视图   for   inf   

人气教程排行