Create, Write, Read, Delete File from MySQL Server(C programming)

This video shows how to create, write, read and delete file from MySQL Server using C programming. It works only on vps and dedicated server

Packages Reguired to compile code:
sudo apt-get install libmysqlclient-dev
sudo apt-get install zlib1g-dev

Command to generate Shared Library:
gcc -shared -o filehandle.so main.o

mysql command to fetch plugin path and folder path where you can create file:
SHOW VARIABLES LIKE ‘plugin_dir’
SHOW VARIABLES LIKE ‘secure_file_priv’

MySQL Function to call plugin:

drop FUNCTION FileHandle;

CREATE FUNCTION FileHandle
RETURNS STRING
SONAME “filehandle.so”;

select FileHandle (‘1′,’/CodeVlog.txt’,’none’);

Enjoy!!!
don’t forget to subscribe on youtube as more code comming.

You may also like...