Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

MySQL views stored procedures and functions, views, and triggers

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Query stored procedures and functions in the database

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 function status; / / function

View the creation code of a stored procedure or function

Show create procedure proc_name

Show create function func_name

two。 View view

SELECT * from information_schema.VIEWS / / View

SELECT * from information_schema.TABLES / / Table

3. View trigger

Method 1:

Syntax: SHOW TRIGGERS [FROM db_name] [LIKE expr]

Example: SHOW TRIGGERS\ G / / trigger

Method 2:

Query the TRIGGERS table in INFORMATION_SCHEMA database

Mysql > SELECT * FROM triggers T WHERE trigger_name= "mytrigger"\ G

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report