我尝试安装“mysqludf_sys”。但我得到了这个错误:
ERROR 1126 (HY000) at line 29: Can't open shared library 'lib_mysqludf_sys.so' (errno: 0 /usr/lib/mysql/plugin/lib_mysqludf_sys.so: cannot open shared object file: No such file or directory)
ERROR: unable to install the UDF
因此,我尝试在 Makefile 中使用以下修改来解决它:
LIBDIR=/usr/lib to LIBDIR=/usr/lib/mysql/plugin
还要确保 gcc 具有 -fPIC 选项,即:
gcc -fPIC -Wall -I/usr/include/mysql -I. -shared lib_mysqludf_sys.c -o $(LIBDIR)/lib_mysqludf_sys.so
但是当我测试 sys_eval 时,我得到:
mysql> SELECT sys_eval('id');
+----------------+
| sys_eval('id') |
+----------------+
| |
+----------------+
1 row in set (0.02 sec)
我应该得到:
mysql> SELECT sys_eval('id');
+-------------------------------------------------+
| sys_eval('id') |
+-------------------------------------------------+
| uid=105(mysql) gid=108(mysql) groups=108(mysql) |
+-------------------------------------------------+
1 row in set (0.01 sec)
我也测试了“sys_exec”来创建一个文件,但没有结果
那么,我应该怎么做才能正确运行这些功能?问候