gpt4 book ai didi

MySQL UDF sys_exec

转载 作者:行者123 更新时间:2023-11-29 02:31:34 35 4
gpt4 key购买 nike

我正在使用 MySQL UDF 函数 sys_exec 在 MySQL 触发器中调用 Java 程序。您能否提供有关我如何将参数传递给 sys_exec 以便它调用 Java 程序的信息?

最佳答案

您可以使用这个 link to use sys_exec function .它说,

sys_exec sys_exec takes one command string argument and executes it. Syntax

sys_exec(arg1) Parameters and Return Values

arg1 : A command string valid for the current operating system or execution environment. returns An (integer) exit code returned by the executed process. Installation

Place the shared library binary in an appropriate location. Log in to mysql as root or as another user with sufficient privileges, and select any database. Then, create the function using the following DDL statement: CREATE FUNCTION sys_exec RETURNS INT SONAME 'lib_mysqludf_sys.so'; The function will be globally available in all databases. The deinstall the function, run the following statement: DROP FUNCTION sys_exec;

要执行 Java 程序,您应该将 arg1 填写为 "java <absolute path to precompiled program to run>" .

注意:java的路径应该事先配置。

希望对你有帮助

关于MySQL UDF sys_exec,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12460809/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com