MySQL query tables, views, triggers, functions, stored procedures

Source: Internet
Author: User
Tags function definition mysql query

1. mysql Queries all tables:

SELECT table_name from INFORMATION_SCHEMA. TABLES WHERE table_schema = ' database name ' and Table_type = ' base TABLE '

MySQL Query build Table statement:

Show create table ' table name '

2.mysql Querying all Views:

SELECT table_name from INFORMATION_SCHEMA. TABLES WHERE table_schema = ' database name ' and table_type = ' VIEW '

MySQL Query view creation statement:

Show CREATE view ' views Name '

3.mysql Query all functions:

SELECT name from Mysql.proc where db= ' ifms ' and type= ' function '

MySQL query function definition statement:

SHOW CREATE function ' name '

4.mysql querying all stored procedures:

SELECT name from Mysql.proc where db= ' ifms ' and type= ' procedure '

MySQL query procedure definition statement:

SHOW CREATE procedure ' Stored procedure name '

5.mysql query all triggers:

SELECT * from INFORMATION_SCHEMA. ' TRIGGERS '

MySQL query trigger definition statement:

SELECT * from information_schema.triggers where trigger_name= ' trigger name ';

Customize the SQL definition according to the information (no resources found ...). For help

MySQL query tables, views, triggers, functions, stored procedures

Related Article

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.