我正在尝试从MariaDB服务器运行python脚本。 我已经为此安装了mysqludf库。 我正在尝试使用sys_exec函数运行脚本,但是没有结果。 我已经创建了测试文件,它只是一个带有信息“ DONE”的.txt文件。
我以root用户身份执行命令,因此我拥有所有特权。 运行命令:
SELECT sys_exec('python3 /home/Documents/test.py')
不执行任何操作并返回错误代码512。运行命令:
SELECT sys_exec('sudo python3 /home/Documents/test.py')
返回错误代码256。
我已经检查了apparmor的状态,似乎没有什么问题:
apparmor module is loaded.
42 profiles are loaded.
40 profiles are in enforce mode.
/sbin/dhclient
/snap/core/4486/usr/lib/snapd/snap-confine
/snap/core/4486/usr/lib/snapd/snap-confine//mount-namespace-capture-helper
/snap/core/6964/usr/lib/snapd/snap-confine
/snap/core/6964/usr/lib/snapd/snap-confine//mount-namespace-capture-helper
/snap/core/7169/usr/lib/snapd/snap-confine
/snap/core/7169/usr/lib/snapd/snap-confine//mount-namespace-capture-helper
/snap/core/7270/usr/lib/snapd/snap-confine
/snap/core/7270/usr/lib/snapd/snap-confine//mount-namespace-capture-helper
/usr/bin/evince
/usr/bin/evince-previewer
/usr/bin/evince-previewer//sanitized_helper
/usr/bin/evince-thumbnailer
/usr/bin/evince//sanitized_helper
/usr/bin/man
/usr/lib/NetworkManager/nm-dhcp-client.action
/usr/lib/NetworkManager/nm-dhcp-helper
/usr/lib/connman/scripts/dhclient-script
/usr/lib/cups/backend/cups-pdf
/usr/lib/snapd/snap-confine
/usr/lib/snapd/snap-confine//mount-namespace-capture-helper
/usr/sbin/cups-browsed
/usr/sbin/cupsd
/usr/sbin/cupsd//third_party
/usr/sbin/ippusbxd
/usr/sbin/tcpdump
man_filter
man_groff
snap-update-ns.core
snap-update-ns.eclipse
snap-update-ns.gnome-calculator
snap-update-ns.gnome-characters
snap-update-ns.gnome-logs
snap-update-ns.gnome-system-monitor
snap-update-ns.pycharm-community
snap.core.hook.configure
snap.gnome-calculator.gnome-calculator
snap.gnome-characters.gnome-characters
snap.gnome-logs.gnome-logs
snap.gnome-system-monitor.gnome-system-monitor
2 profiles are in complain mode.
snap.eclipse.eclipse
snap.pycharm-community.pycharm-community
4 processes have profiles defined.
4 processes are in enforce mode.
/sbin/dhclient (734)
/usr/sbin/cups-browsed (33904)
/usr/sbin/cupsd (33899)
/usr/sbin/cupsd (33928)
0 processes are in complain mode.
0 processes are unconfined but have a profile defined.
我还仔细检查了root是否具有sudo特权,如果确实如此。
是什么原因引起的? 有什么方法可以从MariaDB Server运行python脚本吗?