A small MySQL UDF library for making HTTP requests written in Golang.
Makes an HTTP Get request to the given URL and returns nothing.
`http_touch` ( `URL` )
`URL`
- The URL to request.
We can quickly build a test table of random numbers by running these queries
-- hit our test endpoint
select`http_touch`('http://localhost:48642/');
You will need Golang, which you can get from here https://golang.org/doc/install.
Debian / Ubuntu
sudo apt update
sudo apt install libmysqlclient-dev
You can find your MySQL plugin directory by running this MySQL query
select @@plugin_dir;
then replace /usr/lib/mysql/plugin
below with your MySQL plugin directory.
cd ~ # or wherever you store your git projects
git clone https://github.com/StirlingMarketingGroup/mysql-http.git
cd mysql-http
go build -buildmode=c-shared -o mysql_http.so
sudo cp mysql_http.so /usr/lib/mysql/plugin/mysql_http.so # replace plugin dir here if needed
Enable the function in MySQL by running this MySQL query
create function`http_touch`returns int soname'mysql_http.so';