title: How to connect mysql procedure to websocket?
body: <p>I was set lib_mysqludf_sys.dll library in;</p>
  
  <blockquote>
    <p>C:\Program Files\MySQL\MySQL Server 5.7\lib\plugin</p>
  </blockquote>
  
  <p>And I was created this mysql function;</p>
  
  <pre><code>CREATE FUNCTION sys_exec RETURNS int SONAME 'lib_mysqludf_sys.dll';
  </code></pre>
  
  <p>It's created successful and not throw any exception.</p>
  
  <p>Then I wrote this trigger on mysql;</p>
  
  <pre><code>CREATE DEFINER = CURRENT_USER TRIGGER `bb`.`mytable_AFTER_INSERT` AFTER INSERT ON `mytable` FOR EACH ROW
  BEGIN
  Call new_procedure();
  END
  </code></pre>
  
  <p>And procedure like this;</p>
  
  <pre><code>CREATE DEFINER=`root`@`localhost` PROCEDURE `new_procedure`()
  BEGIN 
      DECLARE cmd CHAR(255); 
      DECLARE result CHAR(255); 
      SET result = sys_exec('curl http://localhost:9095/Laputa');
      INSERT INTO trggr VALUES(result);
  END
  </code></pre>
  
  <p>But sys_exec function return 1 and not connect to url.</p>
  
  <p>How can I connect any websocket from procedure.</p>
  
  <p>My system:
   windows10 64bit, MySql Server 5.7 'version_compile_machine':'x86_64','version_compile_os':'Win64'</p>
  
  <p>I wrote this by looking at them:</p>
  
  <p><a href="https://support.pubnub.com/support/solutions/articles/14000043795-can-i-publish-a-message-via-a-database-trigger-" rel="nofollow noreferrer">https://support.pubnub.com/support/solutions/articles/14000043795-can-i-publish-a-message-via-a-database-trigger-</a></p>
  
  <p><a href="https://stackoverflow.com/questions/27587333/mysql-udf-sys-exec-doesnt-work">MySQL UDF sys_exec() doesn&#39;t work</a></p>
  
  <p><a href="https://stackoverflow.com/questions/25947790/real-time-updates-from-database-using-jsf-java-ee">Real time updates from database using JSF/Java EE</a></p>
  
  <p>Thanks.</p>