---
title: "mysql 存储过程"
author: "javafan_303"
date: "2010-12-13T14:09:44Z"
tags: ["MySQL"]
categories: ["数据库"]
slug: "mysql"
draft: false
lastmod: "2010-12-13T14:13:54Z"
id: 840754
url: "https://cailin.iteye.com/blog/840754"
---

最近在看运营系统的源码，里面用了很多存储过程来生成报表，mysql的存储过程一直没有用过，借此机会保存一下常用的命令

 

 

```
方法一：（直接查询）

select `specific_name` from mysql.proc where db = 'your_db_name' and `type` = 'PROCEDURE'

方法二：（查看数据库里所有存储过程+内容）

show procedure status;

方法三：（查看当前数据库里存储过程列表）

select specific_name from mysql.proc ;

方法四：(查看某一个存储过程的具体内容)

select body from mysql.proc where specific_name = 'your_proc_name';
```