Where are mysql stored procedures stored?

下次还敢
Release: 2024-04-22 19:03:34
Original
662 people have browsed it

MySQL stored procedures are saved in the mysql.proc table, which stores all information about the stored procedures, including name, definition, creator, and modification time.

Where are mysql stored procedures stored?

#Where are MySQL stored procedures stored?

Stored procedures in MySQL are stored in themysql.proctable of the database. This table stores information about all stored procedures created in the database.

Table structure

mysql.procThe table contains the following columns:

  • db: The name of the database to which the stored procedure belongs
  • name: The name of the stored procedure
  • type: The type of the stored procedure (PROCEDUREorFUNCTION)
  • body: The definition of the stored procedure
  • definer: The user and host of the creator of the stored procedure Name
  • created: The timestamp when the stored procedure was created
  • modified: The timestamp when the stored procedure was last modified
  • sql_mode: The SQL mode used by the stored procedure
  • security_type: The security type of the stored procedure (DEFINER,INVOKERorBOTH)
  • comment: Comments on stored procedures

Query stored procedure information

To query information about a specific stored procedure, you can use the following SQL statement:

SELECT * FROM mysql.proc WHERE db = 'database_name' AND name = 'procedure_name';
Copy after login

Modify the stored procedure definition

To modify the definition of a stored procedure, you can use the following SQL statement:

ALTER PROCEDURE database_name.procedure_name [characteristic ...] body;
Copy after login

Delete stored procedures

To delete stored procedures, you can use the following SQL statement:

DROP PROCEDURE database_name.procedure_name;
Copy after login

The above is the detailed content of Where are mysql stored procedures stored?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!