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
Post a Comment