<i id='ps65A'><tr id='ps65A'><dt id='ps65A'><q id='ps65A'><span id='ps65A'><b id='ps65A'><form id='ps65A'><ins id='ps65A'></ins><ul id='ps65A'></ul><sub id='ps65A'></sub></form><legend id='ps65A'></legend><bdo id='ps65A'><pre id='ps65A'><center id='ps65A'></center></pre></bdo></b><th id='ps65A'></th></span></q></dt></tr></i><div id='ps65A'><tfoot id='ps65A'></tfoot><dl id='ps65A'><fieldset id='ps65A'></fieldset></dl></div>

    1. <legend id='ps65A'><style id='ps65A'><dir id='ps65A'><q id='ps65A'></q></dir></style></legend>

      <tfoot id='ps65A'></tfoot>
      • <bdo id='ps65A'></bdo><ul id='ps65A'></ul>

      <small id='ps65A'></small><noframes id='ps65A'>

    2. MySQL UDF sys_exec() 不起作用

      时间:2023-10-26

      <small id='GAoCL'></small><noframes id='GAoCL'>

          <tbody id='GAoCL'></tbody>
        <tfoot id='GAoCL'></tfoot>

            <bdo id='GAoCL'></bdo><ul id='GAoCL'></ul>
          • <legend id='GAoCL'><style id='GAoCL'><dir id='GAoCL'><q id='GAoCL'></q></dir></style></legend>
                <i id='GAoCL'><tr id='GAoCL'><dt id='GAoCL'><q id='GAoCL'><span id='GAoCL'><b id='GAoCL'><form id='GAoCL'><ins id='GAoCL'></ins><ul id='GAoCL'></ul><sub id='GAoCL'></sub></form><legend id='GAoCL'></legend><bdo id='GAoCL'><pre id='GAoCL'><center id='GAoCL'></center></pre></bdo></b><th id='GAoCL'></th></span></q></dt></tr></i><div id='GAoCL'><tfoot id='GAoCL'></tfoot><dl id='GAoCL'><fieldset id='GAoCL'></fieldset></dl></div>

                本文介绍了MySQL UDF sys_exec() 不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我有一个触发器,它调用带有参数的存储过程,参数调用 SET result = sys_exec(cmd);.但它给出了函数 sys_exec 不存在"的错误.

                I have a trigger which calls a stored procedure with parameters which calls SET result = sys_exec(cmd);. But it gives the error "function sys_exec does not exist".

                我不知道该怎么办,周二我有演示文稿,但由于此代码行,我的项目将无法运行.我尝试使用的代码.

                I don't know what to do, on Tuesday I have presentation and because of this code line my project won't work. The codes which I try to work.

                DELIMITER $$
                CREATE PROCEDURE push_message
                (p1   int,
                 p2   int,
                 p3 varchar(20))
                BEGIN
                 DECLARE cmd CHAR(255);
                 DECLARE result CHAR(255);
                 SET cmd = CONCAT('curl https://pubsub.pubnub.com/publish/demo/demo/0/mysql_triggers/0/%22',p1, ',' ,p2, ',' ,p3,'%22');
                 SET result = sys_exec(cmd);
                END$$; 
                
                
                CREATE TRIGGER push_message_trigger AFTER INSERT ON your_table_name_here
                FOR EACH ROW
                CALL push_message(NEW.id, NEW.num, NEW.name);
                

                推荐答案

                尝试:

                mysql> SELECT VERSION();
                +-----------------+
                | VERSION()       |
                +-----------------+
                | 5.5.35-1ubuntu1 |
                +-----------------+
                1 row in set (0.00 sec)
                
                mysql> SHOW VARIABLES LIKE 'plugin_dir';
                +---------------+------------------------+
                | Variable_name | Value                  |
                +---------------+------------------------+
                | plugin_dir    | /usr/lib/mysql/plugin/ | -- copy 'lib_mysqludf_sys.so' here
                +---------------+------------------------+
                1 row in set (0.01 sec)
                
                mysql> DROP FUNCTION IF EXISTS lib_mysqludf_sys_info;
                Query OK, 0 rows affected, 1 warning (0.00 sec)
                
                mysql> DROP FUNCTION IF EXISTS sys_get;
                Query OK, 0 rows affected, 1 warning (0.00 sec)
                
                mysql> DROP FUNCTION IF EXISTS sys_set;
                Query OK, 0 rows affected, 1 warning (0.00 sec)
                
                mysql> DROP FUNCTION IF EXISTS sys_exec;
                Query OK, 0 rows affected, 1 warning (0.00 sec)
                
                mysql> DROP FUNCTION IF EXISTS sys_eval;
                Query OK, 0 rows affected, 1 warning (0.00 sec)
                
                mysql> CREATE FUNCTION lib_mysqludf_sys_info RETURNS string SONAME 'lib_mysqludf_sys.so';
                Query OK, 0 rows affected (0.00 sec)
                
                mysql> CREATE FUNCTION sys_get RETURNS string SONAME 'lib_mysqludf_sys.so';
                Query OK, 0 rows affected (0.00 sec)
                
                mysql> CREATE FUNCTION sys_set RETURNS int SONAME 'lib_mysqludf_sys.so';
                Query OK, 0 rows affected (0.00 sec)
                
                mysql> CREATE FUNCTION sys_exec RETURNS int SONAME 'lib_mysqludf_sys.so';
                Query OK, 0 rows affected (0.00 sec)
                
                mysql> CREATE FUNCTION sys_eval RETURNS string SONAME 'lib_mysqludf_sys.so';
                Query OK, 0 rows affected (0.00 sec)
                
                mysql> SELECT sys_exec('curl http://stackoverflow.com/');
                +--------------------------------------------+
                | sys_exec('curl http://stackoverflow.com/') |
                +--------------------------------------------+
                |                                          0 |
                +--------------------------------------------+
                1 row in set (0.12 sec)
                

                更多详情,请访问:24.3.2.5 编译安装用户定义的函数.

                这篇关于MySQL UDF sys_exec() 不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:将可变参数列表传递给 SqlServer2008 存储过程的理智/快速方法 下一篇:如何在 SQL 存储过程中实现日志记录和错误报告?

                相关文章

                  • <bdo id='sGd6i'></bdo><ul id='sGd6i'></ul>

                  1. <tfoot id='sGd6i'></tfoot>
                    <legend id='sGd6i'><style id='sGd6i'><dir id='sGd6i'><q id='sGd6i'></q></dir></style></legend>
                  2. <small id='sGd6i'></small><noframes id='sGd6i'>

                    <i id='sGd6i'><tr id='sGd6i'><dt id='sGd6i'><q id='sGd6i'><span id='sGd6i'><b id='sGd6i'><form id='sGd6i'><ins id='sGd6i'></ins><ul id='sGd6i'></ul><sub id='sGd6i'></sub></form><legend id='sGd6i'></legend><bdo id='sGd6i'><pre id='sGd6i'><center id='sGd6i'></center></pre></bdo></b><th id='sGd6i'></th></span></q></dt></tr></i><div id='sGd6i'><tfoot id='sGd6i'></tfoot><dl id='sGd6i'><fieldset id='sGd6i'></fieldset></dl></div>