Mysql statements used to query stored procedures and functions in a database

Source: Internet
Author: User

Method 1:
Select 'name' from mysql. proc where db = 'your _ db_name 'and 'type' = 'Procedure' // Stored PROCEDURE
Select 'name' from mysql. proc where db = 'your _ db_name 'and 'type' = 'function' // FUNCTION
Method 2:
Show procedure status; // Stored procedure

Show procedure status where db = 'servant _ 591up'

Show function status; // function

View the code for creating a stored procedure or function
Show create procedure proc_name;
Show create function func_name;
View
SELECT * from information_schema.VIEWS // View
SELECT * from information_schema.TABLES // table
View triggers
Method 1:
Syntax: show triggers [FROM db_name] [LIKE expr]
Instance: show triggers \ G // trigger
Method 2:
Query the TRIGGERS table in the INFORMATION_SCHEMA Database
Mysql> SELECT * FROM triggers t where trigger_name = "mytrigger" \ G

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.