How do I view my stored procedures in phpMyAdmin?

前端 未结 11 536
你的背包
你的背包 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:38

    In PHPMYADMIN enter image description here3.5.2.2 version you just click on routines link in top. See the attached image

    0 讨论(0)
  • 2020-12-12 16:41

    View stored procedures in 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.

    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.

    0 讨论(0)
  • 2020-12-12 16:41

    In short you can use this sql

    SHOW CREATE PROCEDURE Sample;
    

    More information here

    • http://dev.mysql.com/doc/refman/5.0/en/show-create-procedure.html
    • http://dev.mysql.com/doc/refman/5.0/en/faqs-stored-procs.html#qandaitem-B-4-1-6

    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)

    SELECT ROUTINE_TYPE, ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA='dbname';
    
    0 讨论(0)
  • 2020-12-12 16:49

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

    There you can edit/drop all your stored procedures

    0 讨论(0)
  • 2020-12-12 16:49

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

    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

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

    0 讨论(0)
  • 2020-12-12 16:53
    select routine_definition
    from information_schema.routines
    where routine_schema = 'db_name'
    and routine_name = 'sp_name';
    
    0 讨论(0)
提交回复
热议问题