How to Send UDP Packet Using Mysql Databse

How to Send UDP Packet Using Mysql Databse


 Step 1. Copy send_udp.so file to the following path using root user:

[root@localhost ~]#  /usr/lib64/mysql/plugin/

Step2. Change the file permission using the command: 

[root@localhost plugin]#  chmod 755 send_udp.so

Step3. Manual  Installation

To add this function to your mysql execute this SQL command as root in mysql server

mysql> CREATE FUNCTION send_udp RETURNS INTEGER SONAME "send_udp.so";

Note:-  Here send_udp is the function name we have created and send_udp.so is the file that we have copied in above steps.

Step4. Example of use:

Here 127.0.0.1 is the ip address  which must be in network and 1234 is the port.

mysql> select send_udp('127.0.0.1',1234,'Test Message');

+-------------------------------------------+

| send_udp('127.0.0.1',1234,'Test Message') |

+-------------------------------------------+

|                                         0 |

+-------------------------------------------+

1 row in set (0,00 sec)

Step5. Now you can use this command in your procedure and trigger for sending  udp packets.


Comments

Popular posts from this blog

MySQL Point in Time Recovery: How To Configure And How Does it Work?

MySQL Replication Switchover: Step-by-Step Guide

Mysql Commercial Mysqlbackup:How to take Differential or Incremental Backup and resotre using mysqlbackup utility in mysql 8.0.37 enterprise edition