A sample MySQLD component implementing a http server using libmicrohttpd.
ATTENTION! THIS IS NOT PRODUCTION CODE! USE AT YOUR OWN RISK! IT DOESN'T DO ANY AUTHENTICATION!
To compile:
- fetch the mysql-8.0 source code: git clone https://github.com/mysql/mysql-server mysql-server
- put the component source in components/httpd_table: cd mysql-server/components; git clone https://github.com/gkodinov/mysql_httpd_table_access.git httpd_table
- procure libmicrohttpd and compile it or download the binaries from https://www.gnu.org/software/libmicrohttpd/
- compile the server and the component, e.g. cmake -DWITH_MICROHTTPD= ..
- start mysqld with the right --plugin-dir containing the component binary
- create the httpd.replies SQL table by running init.sql against the server
- INSTALL COMPONENT "file://component_httpd_table";
- Access the HTTP server at port 18080, e.g. http://localhost:18080?id=1