随笔 - 746  文章 - 0  评论 - 39  阅读 - 79万

Mysql:Where are stored {procedures | functions | triggers} ? (例程)存储过程、函数、触发器,存在哪儿?

 

A.4.7.

Where are stored procedures stored?

 

In the proc table of the mysql system database. However, you should not access the tables in the system database directly. Instead, query the INFORMATION_SCHEMA ROUTINES and PARAMETERS tables. See Section 24.21, “The INFORMATION_SCHEMA ROUTINES Table”, and Section 24.15, “The INFORMATION_SCHEMA PARAMETERS Table”.

You can also use SHOW CREATE FUNCTION to obtain information about stored functions, and SHOW CREATE PROCEDURE to obtain information about stored procedures. See Section 13.7.5.9, “SHOW CREATE PROCEDURE Statement”.

 

【vs】

 

 

A.5.6.

Is there a way to view all triggers in a given database?

 

Yes. You can obtain a listing of all triggers defined on database dbname using a query on the INFORMATION_SCHEMA.TRIGGERS table such as the one shown here:

SELECT TRIGGER_NAME, EVENT_MANIPULATION, EVENT_OBJECT_TABLE, ACTION_STATEMENT
    FROM INFORMATION_SCHEMA.TRIGGERS
    WHERE TRIGGER_SCHEMA='dbname';

For more information about this table, see Section 24.29, “The INFORMATION_SCHEMA TRIGGERS Table”.

You can also use the SHOW TRIGGERS statement, which is specific to MySQL. See Section 13.7.5.38, “SHOW TRIGGERS Statement”.

A.5.7.

Where are triggers stored?

 

Triggers are stored in .TRG files, with one such file one per table.

 

posted on   jinzhenshui  阅读(133)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
历史上的今天:
2009-03-25 Linux (转)解析 xinetd.conf
2009-03-25 Linux 架设telnet服务器

点击右上角即可分享
微信分享提示