如何在phpadmin中查看存储过程?

时间:2021-07-31 02:06:05

I created a stored procedure in phpMyAdmin

我在phmypadmin中创建了一个存储过程

CREATE PROCEDURE Sample()
SELECT * FROM feedback

Where could I view this this procedure? If it's not possible in phpMyAdmin, what is/are some good program(s) that have the feature to write, store, and view stored procedures, tables, etc?

我在哪里可以看到这个过程?如果在phmypadmin中不可能,有哪些好的程序具有编写、存储和查看存储过程、表等功能?

11 个解决方案

#1


73  

View stored procedures in phpmyadmin:

查看phpmyadmin中的存储过程:

Query:

查询:

SELECT routine_definition
FROM information_schema.routines
WHERE 
routine_name = 'procedure_name' AND routine_schema = 'databasename';

Here's how to get there in phpmyadmin.

以下是如何在phpmyadmin中实现的。

如何在phpadmin中查看存储过程?

The routines option is available in phpmyadmin. The link is not visible in PHPmyadmin until you have at least one stored procedure. See the above image and click the routines link under structure tab.

例程选项在phmypadmin中可用。这个链接在PHPmyadmin中是不可见的,除非您至少有一个存储过程。查看上面的图片并单击“结构”选项卡下的例程链接。

#2


19  

select routine_definition
from information_schema.routines
where routine_schema = 'db_name'
and routine_name = 'sp_name';

#3


6  

This answer shows how to view them without a script.

这个答案显示了如何在没有脚本的情况下查看它们。

"Once you created the stored procedure it will appear in the Routines fieldset below your tables (in the Structure tab), and you can easily change/drop it."

“一旦您创建了存储过程,它将出现在您的表(结构选项卡)下的例程中,您可以轻松地更改/删除它。”

#4


5  

You can select "information_schema" as database and query all entries form the table "routines", in case u don't want to use SQL everytime.

您可以选择“information_schema”作为数据库,并查询表“例程”中的所有条目,以防您不希望每次都使用SQL。

#5


4  

In short you can use this sql

简而言之,您可以使用这个sql

SHOW CREATE PROCEDURE Sample;

More information here

更多的信息在这里

UPDATE: If you don't remember the names, you can query the INFORMATION_SCHEMA database to see all the procedures (well you can use a LIKE on ROUTINE_NAME, if you remember a partial name)

更新:如果您不记得名称,可以查询INFORMATION_SCHEMA数据库以查看所有的过程(如果您记得部分名称,可以在ROUTINE_NAME上使用LIKE)

SELECT ROUTINE_TYPE, ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA='dbname';

#6


3  

under phpMyAdmin, click on your database (Not on the table), then click on "+Routines".

在phpMyAdmin下,单击数据库(不在表上),然后单击“+例程”。

There you can edit/drop all your stored procedures

在那里,您可以编辑/删除所有存储过程

#7


3  

show procedure status;      -- will show you the stored procedures.
show create procedure MY_PROC;  -- will show you the definition of a procedure. 
help show;          -- show all the available options for the show command.

#8


3  

In PHPMYADMIN 如何在phpadmin中查看存储过程?3.5.2.2 version you just click on routines link in top. See the attached image

在PHPMYADMIN 3.5.2.2版本中,您只需单击顶部的例程链接。参阅附上的图片

#9


1  

After clicking home, databases, the database I created the procedure in. It opens the structure window of that database. In the menu bar: "structure, sql, search ,..." there should be routines, if it's not then click on the right item called more and it should be there (curse my netbook for not having a 24 inch screen).

单击home、database之后,我在其中创建的数据库。它打开该数据库的结构窗口。在菜单栏:“结构、sql、搜索……”中应该有一些例程,如果没有的话,那么点击“more”,它应该在那里(诅咒我的上网本没有24英寸的屏幕)。

To make sure your database has the procedure click on export, choose "Custom - display all possible options", under "Output:" choose "View output as text", under "Format-specific options:" choose "structure" (just under "dump table"),make sure "Add CREATE PROCEDURE / FUNCTION / EVENT statement" is selected (just a little under "dump table"). Now click Go and your procedure should show up

确保你的数据库程序点击导出,选择“自定义-显示所有可能的选项”,在“输出:“选择“视图输出为文本”,在“特定于格式的选项:“选择“结构”(略低于“转储表”),确保“添加创建过程/函数/事件声明”被选中(只是有点“转储表”)。现在单击Go,您的过程将显示出来

using: Version information: 3.5.2, latest stable version: 3.5.2.2

使用:版本信息:3.5.2,最新稳定版本:3.5.2.2

#10


1  

Use the Adminer data-base interface. Unlike PHPMyAdmin, it's perfectly able to view, edit and invoke stored procedures, where PHPMyAdmin fails with tons of errors (errors when you try to run an SQL statement to create one, errors when you try to invoke one, errors when you try to alter one already created, beside of its inability to list the ones defined… I really wonder what PHPMyAdmin do with with SQL queries text before it submit it to the DB, that's frightening).

使用Adminer数据基接口。与PHPMyAdmin,完全能够查看,编辑和调用存储过程,PHPMyAdmin失败吨错误(错误当你试图运行一个SQL语句创建一个,当你试图调用一个错误,错误当你试图改变一个已经创建,旁边的无法定义的列表…我真的很想知道PHPMyAdmin和SQL查询与文本之前提交DB,那是可怕的)。

Just copy the Adminer PHP file at some location of you web server, open the corresponding URL. After you logged-in and selected a data-base, below the list of tables, you will see a list of the stored procedures, with a Call button. Clicking on the procedure link, you will also be able to alter (edit) it.

只需在web服务器的某个位置复制Adminer PHP文件,打开相应的URL。登录并选择一个数据库后,在表列表下面,您将看到一个存储过程列表,其中包含一个Call按钮。单击过程链接,您还可以修改(编辑)它。

Honestly, I recommand you gave up with PHPMyAdmin, it's perfectly incapable of properly dealing with this (note that SQLBuddy too, fails in some way with that).

老实说,我建议您放弃PHPMyAdmin,它完全无法正确地处理这个问题(请注意,SQLBuddy也在某种程度上失败了)。

-- edit --

——编辑

For completeness, you may also list stored procedures with this SQL query:

为了完整性,您还可以使用这个SQL查询列出存储过程:

show procedure status;

Or this one, to retrieve a procedure whose name is known:

或者这个,检索一个名字已知的过程:

show procedure status where Name = 'name';

#11


1  

Don't forget that in smaller screens you'll have to use the "more" menu. 如何在phpadmin中查看存储过程?

别忘了,在小屏幕上,你必须使用“更多”菜单。

#1


73  

View stored procedures in phpmyadmin:

查看phpmyadmin中的存储过程:

Query:

查询:

SELECT routine_definition
FROM information_schema.routines
WHERE 
routine_name = 'procedure_name' AND routine_schema = 'databasename';

Here's how to get there in phpmyadmin.

以下是如何在phpmyadmin中实现的。

如何在phpadmin中查看存储过程?

The routines option is available in phpmyadmin. The link is not visible in PHPmyadmin until you have at least one stored procedure. See the above image and click the routines link under structure tab.

例程选项在phmypadmin中可用。这个链接在PHPmyadmin中是不可见的,除非您至少有一个存储过程。查看上面的图片并单击“结构”选项卡下的例程链接。

#2


19  

select routine_definition
from information_schema.routines
where routine_schema = 'db_name'
and routine_name = 'sp_name';

#3


6  

This answer shows how to view them without a script.

这个答案显示了如何在没有脚本的情况下查看它们。

"Once you created the stored procedure it will appear in the Routines fieldset below your tables (in the Structure tab), and you can easily change/drop it."

“一旦您创建了存储过程,它将出现在您的表(结构选项卡)下的例程中,您可以轻松地更改/删除它。”

#4


5  

You can select "information_schema" as database and query all entries form the table "routines", in case u don't want to use SQL everytime.

您可以选择“information_schema”作为数据库,并查询表“例程”中的所有条目,以防您不希望每次都使用SQL。

#5


4  

In short you can use this sql

简而言之,您可以使用这个sql

SHOW CREATE PROCEDURE Sample;

More information here

更多的信息在这里

UPDATE: If you don't remember the names, you can query the INFORMATION_SCHEMA database to see all the procedures (well you can use a LIKE on ROUTINE_NAME, if you remember a partial name)

更新:如果您不记得名称,可以查询INFORMATION_SCHEMA数据库以查看所有的过程(如果您记得部分名称,可以在ROUTINE_NAME上使用LIKE)

SELECT ROUTINE_TYPE, ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA='dbname';

#6


3  

under phpMyAdmin, click on your database (Not on the table), then click on "+Routines".

在phpMyAdmin下,单击数据库(不在表上),然后单击“+例程”。

There you can edit/drop all your stored procedures

在那里,您可以编辑/删除所有存储过程

#7


3  

show procedure status;      -- will show you the stored procedures.
show create procedure MY_PROC;  -- will show you the definition of a procedure. 
help show;          -- show all the available options for the show command.

#8


3  

In PHPMYADMIN 如何在phpadmin中查看存储过程?3.5.2.2 version you just click on routines link in top. See the attached image

在PHPMYADMIN 3.5.2.2版本中,您只需单击顶部的例程链接。参阅附上的图片

#9


1  

After clicking home, databases, the database I created the procedure in. It opens the structure window of that database. In the menu bar: "structure, sql, search ,..." there should be routines, if it's not then click on the right item called more and it should be there (curse my netbook for not having a 24 inch screen).

单击home、database之后,我在其中创建的数据库。它打开该数据库的结构窗口。在菜单栏:“结构、sql、搜索……”中应该有一些例程,如果没有的话,那么点击“more”,它应该在那里(诅咒我的上网本没有24英寸的屏幕)。

To make sure your database has the procedure click on export, choose "Custom - display all possible options", under "Output:" choose "View output as text", under "Format-specific options:" choose "structure" (just under "dump table"),make sure "Add CREATE PROCEDURE / FUNCTION / EVENT statement" is selected (just a little under "dump table"). Now click Go and your procedure should show up

确保你的数据库程序点击导出,选择“自定义-显示所有可能的选项”,在“输出:“选择“视图输出为文本”,在“特定于格式的选项:“选择“结构”(略低于“转储表”),确保“添加创建过程/函数/事件声明”被选中(只是有点“转储表”)。现在单击Go,您的过程将显示出来

using: Version information: 3.5.2, latest stable version: 3.5.2.2

使用:版本信息:3.5.2,最新稳定版本:3.5.2.2

#10


1  

Use the Adminer data-base interface. Unlike PHPMyAdmin, it's perfectly able to view, edit and invoke stored procedures, where PHPMyAdmin fails with tons of errors (errors when you try to run an SQL statement to create one, errors when you try to invoke one, errors when you try to alter one already created, beside of its inability to list the ones defined… I really wonder what PHPMyAdmin do with with SQL queries text before it submit it to the DB, that's frightening).

使用Adminer数据基接口。与PHPMyAdmin,完全能够查看,编辑和调用存储过程,PHPMyAdmin失败吨错误(错误当你试图运行一个SQL语句创建一个,当你试图调用一个错误,错误当你试图改变一个已经创建,旁边的无法定义的列表…我真的很想知道PHPMyAdmin和SQL查询与文本之前提交DB,那是可怕的)。

Just copy the Adminer PHP file at some location of you web server, open the corresponding URL. After you logged-in and selected a data-base, below the list of tables, you will see a list of the stored procedures, with a Call button. Clicking on the procedure link, you will also be able to alter (edit) it.

只需在web服务器的某个位置复制Adminer PHP文件,打开相应的URL。登录并选择一个数据库后,在表列表下面,您将看到一个存储过程列表,其中包含一个Call按钮。单击过程链接,您还可以修改(编辑)它。

Honestly, I recommand you gave up with PHPMyAdmin, it's perfectly incapable of properly dealing with this (note that SQLBuddy too, fails in some way with that).

老实说,我建议您放弃PHPMyAdmin,它完全无法正确地处理这个问题(请注意,SQLBuddy也在某种程度上失败了)。

-- edit --

——编辑

For completeness, you may also list stored procedures with this SQL query:

为了完整性,您还可以使用这个SQL查询列出存储过程:

show procedure status;

Or this one, to retrieve a procedure whose name is known:

或者这个,检索一个名字已知的过程:

show procedure status where Name = 'name';

#11


1  

Don't forget that in smaller screens you'll have to use the "more" menu. 如何在phpadmin中查看存储过程?

别忘了,在小屏幕上,你必须使用“更多”菜单。