mysql view all stored procedures, functions, views, triggers, tables

Querying stored procedures and functions in the database

method one:

       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'   //函数

Method Two:

         show procedure status; //Stored procedure

        show function status; //function

View the creation code of a stored procedure or function

show create procedure proc_name;
show create function func_name;

View view

SELECT * from information_schema.VIEWS //Views

SELECT * from information_schema.TABLES   //表

View triggers

method one:
语法:SHOW TRIGGERS [FROM db_name] [LIKE expr]
Example: SHOW TRIGGERS\G //Trigger

Method Two:
Query the TRIGGERS table in the INFORMATION_SCHEMA database
mysql>SELECT * FROM triggers T WHERE trigger_name=”mytrigger” \G

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325490436&siteId=291194637