測試環境 CentOS8 – MariaDB 10.3.28
[root@localhost ~]# mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 10 Server version: 10.3.28-MariaDB-log MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
SQL Shell
在 SQL Shell 下面是可以直接透過 system 指令去執行 Linux 的 Shell 程式.
MariaDB [(none)]> system bash [root@localhost ~]# exit exit MariaDB [(none)]> system ls anaconda-ks.cfg Desktop Documents Downloads Music original-ks.cfg Pictures Public temp Templates Videos
Stored Routines ( Procedure , Function 或是 Trigger )
不過這個 system 指令基本安全考量才不能使用在 Stored Routines ( Procedure , Function 或是 Trigger ) 上,不過可以透過 User Define Function (UDF) 的方式來做,
- mysql-udf – https://github.com/topics/mysql-udf
使用請參考 – https://benjr.tw/105113 - lib_mysqludf_sys library – https://github.com/mysqludf/lib_mysqludf_sys
沒有解決問題,試試搜尋本站其他內容