반응형
[mysql 트리거]
create trigger trigger_test
after update on udf
for each row
begin
declare cmd char(255);
declare result int;
set cmd = CONCAT('sudo /usr/bin/php','/usr/share/nginx/html/trigger.php');
set result = sys_exec(cmd) ;
END;
[php스쿨] 에 올린 질문내용
에러내용은
FUNCTION IMPORT_GAMES.sys_exec does not exist. // 데이터베이스가 IMPORT_GAEMS입니다. 관련 라이브러리 설치 하였음
참고사이트:
http://crazytechthoughts.blogspot.kr/2011/12/call-external-program-from-mysql.html
http://stackoverflow.com/questions/20437759/calling-a-php-file-by-using-mysql-trigger
http://stackoverflow.com/questions/1467369/invoking-a-php-script-from-a-mysql-trigger
http://bernardodamele.blogspot.kr/2009/01/command-execution-with-mysql-udf.html
http://rpbouman.blogspot.kr/2007/09/creating-mysql-udfs-with-microsoft.html
http://stackoverflow.com/questions/3651951/mysql-triggers-after-insert-trigger-udf-sys-exec-issue
http://stackoverflow.com/questions/24432115/trouble-calling-a-php-script-from-mysql-trigger
http://blog.naver.com/kf80s/220122441917
http://blog.naver.com/bunny121/140010784460
https://patternbuffer.wordpress.com/2012/09/14/triggering-shell-script-from-mysql/
http://stackoverflow.com/questions/1467369/invoking-a-php-script-from-a-mysql-trigger?lq=1
FUNCTION IMPORT_GAMES.sys_exec does not exist. // 데이터베이스가 IMPORT_GAEMS입니다. 관련 라이브러리 설치 하였음
참고사이트:
http://crazytechthoughts.blogspot.kr/2011/12/call-external-program-from-mysql.html
http://stackoverflow.com/questions/20437759/calling-a-php-file-by-using-mysql-trigger
http://stackoverflow.com/questions/1467369/invoking-a-php-script-from-a-mysql-trigger
http://bernardodamele.blogspot.kr/2009/01/command-execution-with-mysql-udf.html
http://rpbouman.blogspot.kr/2007/09/creating-mysql-udfs-with-microsoft.html
http://stackoverflow.com/questions/3651951/mysql-triggers-after-insert-trigger-udf-sys-exec-issue
http://stackoverflow.com/questions/24432115/trouble-calling-a-php-script-from-mysql-trigger
http://blog.naver.com/kf80s/220122441917
http://blog.naver.com/bunny121/140010784460
https://patternbuffer.wordpress.com/2012/09/14/triggering-shell-script-from-mysql/
http://stackoverflow.com/questions/1467369/invoking-a-php-script-from-a-mysql-trigger?lq=1
[ ▼ 질문관련 참고 Source ]
1 2 3 4 5 6 7 8 9 | DELIMITER @@ CREATE TRIGER TEST_TRIGGER AFTER UPDATE ON udf FOR EACH ROW BEGIN DECLARE cmd char (255); DECLARE result CHAR (15); SET cmd = concat( 'sudo php /usr/share/nginx/html/' , 'trigger.php' ); SET result = sys_exec(cmd); END ; @@ DELIMITER; |
반응형
'아카이브 > MySQL' 카테고리의 다른 글
muliple insert query (0) | 2016.06.10 |
---|---|
자주 참고하는(깜박하는) 쿼리문들 (0) | 2015.02.13 |
[Mysql] 데이터베이스 한글 설정 (0) | 2015.01.22 |
[mysql] 백업/복구 (0) | 2015.01.22 |
[mysql] primary key, foreign key 생성/수정 (0) | 2015.01.22 |