developer tip

phpMyAdmin에서 저장 프로 시저를 보려면 어떻게해야합니까?

copycodes 2021. 1. 6. 08:31
반응형

phpMyAdmin에서 저장 프로 시저를 보려면 어떻게해야합니까?


phpMyAdmin에서 저장 프로 시저를 만들었습니다.

CREATE PROCEDURE Sample()
SELECT * FROM feedback

이 절차는 어디에서 볼 수 있습니까? phpMyAdmin에서 가능하지 않은 경우 저장 프로 시저, 테이블 등을 작성, 저장 및 볼 수있는 기능이있는 좋은 프로그램은 무엇입니까?


phpmyadmin에서 저장 프로 시저보기 :

질문:

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

phpmyadmin으로 이동하는 방법은 다음과 같습니다.

phpmyadmin 스크린 샷

routines옵션은에서 사용할 수 있습니다 phpmyadmin. 링크는 하나 이상의 저장 프로 시저가 있어야 PHPmyadmin에 표시됩니다. 위의 이미지를보고 routines아래 링크를 클릭 structure하십시오.


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

답변 은 스크립트없이 보는 방법을 보여줍니다.

"저장 프로 시저를 생성하면 테이블 아래의 루틴 필드 셋 (구조 탭)에 나타나며 쉽게 변경 / 삭제할 수 있습니다."


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.


In short you can use this 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)

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

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

There you can edit/drop all your stored procedures


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.

In PHPMYADMIN 여기에 이미지 설명 입력3.5.2.2 version you just click on routines link in top. See the attached image


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


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


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.

솔직히, 나는 당신이 PHPMyAdmin을 포기할 것을 권합니다. 이것은 이것을 제대로 처리 할 수 ​​없습니다. (SQLBuddy도 어떤 식 으로든 실패합니다).

-- 편집하다 --

완전성을 위해 다음 SQL 쿼리를 사용하여 저장 프로 시저를 나열 할 수도 있습니다.

show procedure status;

또는 이름이 알려진 프로 시저를 검색하려면 다음을 수행하십시오.

show procedure status where Name = 'name';

참조 URL : https://stackoverflow.com/questions/6115573/how-do-i-view-my-stored-procedures-in-phpmyadmin

반응형