Get the App
SLTechnology News&Howtos  ›  Database  › 

How to manage stored procedures in MYSQL

Shulou Source: shulou.com Published: 2022-05-31 19:20:33 10月19日 Update

Today, I will talk to you about how to manage stored procedures in MYSQL. Many people may not know much about it. In order to make you understand better, the editor has summarized the following for you. I hope you can get something according to this article.

View the stored procedure function name:

Stored procedure: (notice that the field name,type is flanked by the key under ESC)

Select `name` from mysql.proc where db = 'your_db_name' and `type` =' PROCEDURE'

Show procedure status

Function:

Select `name` from mysql.proc where db = 'your_db_name' and `type` =' FUNCTION'

Show function status

View stored procedures and function codes:

Show create procedure proc_name

Show create function func_name

View the view:

SELECT * from information_schema.VIEWS

View the table:

SELECT * from information_schema.TABLES / / Table

View triggers:

Method 1:

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

Example: SHOW TRIGGERSG / / trigger

Method 2:

Query the TRIGGERS table in INFORMATION_SCHEMA database

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

So, modify or recompile a stored procedure as follows:

Select `name` from mysql.proc

Tee c:1.txt

Show create procedure procedure_name G

Notee

Drop procedure procedure_name

Delimiter / /

Create procedure .

/ /

Delimiter

Select `name` from mysql.proc

Show create procedure procedure_name G

[@ more@]

Mysql > help

For information about MySQL products and services, visit:

Http://www.mysql.com/

For developer information, including the MySQL Reference Manual, visit:

Http://dev.mysql.com/

To buy MySQL Enterprise support, training, or other products, visit:

Https://shop.mysql.com/

List of all MySQL commands:

Note that all text commands must be first on line and end with';'

?) Synonym for `help'.

Clear (c) Clear the current input statement.

Connect (r) Reconnect to the server. Optional arguments are db and host.

Delimiter (d) Set statement delimiter.

Ego (G) Send command to mysql server, display result vertically.

Exit (Q) Exit mysql. Same as quit.

Go (g) Send command to mysql server.

Help (h) Display this help.

Notee (t) Don't write into outfile.

Print (p) Print current command.

Prompt (R) Change your mysql prompt.

Quit (Q) Quit mysql.

Rehash (#) Rebuild completion hash.

Source (.) Execute an SQL script file. Takes a file name as an argument.

Status (s) Get status information from the server.

Tee (T) Set outfile [to_outfile]. Append everything into given outfile.

Use (u) Use another database. Takes database name as argument.

Charset (C) Switch to another charset. Might be needed for processing binlog

With multi-byte charsets.

Warnings (W) Show warnings after every statement.

Nowarning (w) Don't show warnings after every statement.

For server side help, type 'help contents'

After reading the above, do you have any further understanding of how to manage stored procedures in MYSQL? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Tags: Procedure storage content function management method trigger code field instance data database more knowledge article industry view grammar information information channel Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Linux Shulou Information Huawei Microsoft