How do I view my stored procedures in phpMyAdmin?

前端 未结 11 537
你的背包
你的背包 2020-12-12 15:57

I created a stored procedure in phpMyAdmin

CREATE PROCEDURE Sample()
SELECT * FROM feedback

Where could I view this this procedure? If it\'

相关标签:
11条回答
  • 2020-12-12 16:55
    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.
    
    0 讨论(0)
  • 2020-12-12 16:55

    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).

    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.

    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).

    -- edit --

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

    show procedure status;
    

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

    show procedure status where Name = 'name';
    
    0 讨论(0)
  • 2020-12-12 17:01

    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.

    0 讨论(0)
  • 2020-12-12 17:02

    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."

    0 讨论(0)
  • 2020-12-12 17:03

    Don't forget that in smaller screens you'll have to use the "more" menu. phpMyAdmin

    0 讨论(0)
提交回复
热议问题