Home > Database > Mysql Tutorial > body text

c-关于mysql UDF函数库执行无效问题

WBOY
Release: 2016-06-06 09:42:04
Original
1290 people have browsed it

cudfmysql

项目里打算对Mysql数据库中某一张表做监控,当表中插入数据是调用linux系统的shell脚本,所以在mysql中写自定义函数调用操作系统命令,在网上找到了相关的UDF包(lib_mysqludf_sys_0.0.3.rar)
看到网上有人使用,说没问题,比如这样一篇:http://blog.csdn.net/cnbird2008/article/details/4922078。
但是我使用过后,里面的方法有2个主要的没法用,比如这个
___ _select sys_exec('/root/test/testExcute.sh');执行这个语句

mysql> select sys_exec('/root/test/testExcute.sh');
+--------------------------------------+
| sys_exec('/root/test/testExcute.sh') |
+--------------------------------------+
| 32256 |
+--------------------------------------+
1 row in set (0.02 sec)
而实际上脚本testExcute.sh根本没运行
返回32256 ,看了下实现的源代码,这个里面似乎主要调用了C中system(),
不知道问题具体出现在哪儿?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template