Mysql: Where are stored {procedures | functions | triggers} (routine) stored procedures, functions, triggers, where there is??

 

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.

 

Guess you like

Origin www.cnblogs.com/jinzhenshui/p/12565900.html