How to include a .sh (script) file in Mysql stored procedure? -


is possible include script file (.sh file) inside stored procedure in mysql? if yes, how? , if no, why?

like @mu short said:

you need install these udf's from: http://www.mysqludf.org/lib_mysqludf_sys/index.php
here's download link: http://www.mysqludf.org/lib_mysqludf_sys/lib_mysqludf_sys_0.0.3.tar.gz

note shell commands run privileges of mysql user, not privileges of user that's connecting mysql.
security point of view bad idea.

note warning in link:

a note of caution careful in deciding whether need function. udfs available database users - cannot grant execute privileges them. commandstring passed sys_exec can pretty everything, exposing function poses real security hazard.

even benign user, possible accidentally lot of damage it. call executed privileges of os user runs mysql, entirely feasible delete mysql's data directory, or worse.

the function intended specialized mysql applications 1 needs extended control on operating system. currently, not have udf's ftp, email , http, , function can used implement such functionality in case necessary (datawarehouse staging areas case in example).

you have been warned! if don't see hazard, please don't try find it; trust me on this.

if decide use library in production environment, make sure specific commands can run , file access limited using apparmor.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -