64 lines
1.5 KiB
Markdown
64 lines
1.5 KiB
Markdown
|
# MySQL extensions
|
||
|
|
||
|
This project contains an authentication plugin and functions to extend MySQL
|
||
|
functionality.
|
||
|
|
||
|
## Compiling
|
||
|
|
||
|
Install basic tools for compiling.
|
||
|
```
|
||
|
$ apt-get install build-essential devscripts dh-autoreconf
|
||
|
```
|
||
|
|
||
|
Install MySQL and GLib development libraries.
|
||
|
```
|
||
|
$ apt-get install libmysqld-dev libglib2.0-dev
|
||
|
```
|
||
|
|
||
|
Compile and generate Debian package for MySQL 5.
|
||
|
```
|
||
|
$ debuild -uc -us -b
|
||
|
```
|
||
|
|
||
|
Compile and generate Debian package for MySQL 8.
|
||
|
```
|
||
|
$ debuild --set-envvar MYSQL8=TRUE -uc -us -b
|
||
|
```
|
||
|
|
||
|
## Installing
|
||
|
|
||
|
Install Debian package.
|
||
|
```
|
||
|
$ dpkg -i vn-mysql_[version]_[arch].deb
|
||
|
```
|
||
|
|
||
|
Register plugin and functions into MySQL.
|
||
|
```
|
||
|
INSTALL PLUGIN proxy_auth SONAME 'proxy_auth.so';
|
||
|
CREATE AGGREGATE FUNCTION minacum RETURNS INT SONAME 'minacum.so';
|
||
|
CREATE AGGREGATE FUNCTION multimax RETURNS INT SONAME 'multimax.so';
|
||
|
CREATE FUNCTION sql_printf RETURNS STRING SONAME 'sql_printf.so';
|
||
|
```
|
||
|
|
||
|
## Uninstalling
|
||
|
|
||
|
Deregister plugin and functions from MySQL.
|
||
|
```
|
||
|
UNINSTALL PLUGIN proxy_auth;
|
||
|
DROP FUNCTION IF EXISTS minacum;
|
||
|
DROP FUNCTION IF EXISTS multimax;
|
||
|
DROP FUNCTION IF EXISTS sql_printf;
|
||
|
```
|
||
|
|
||
|
## Built with
|
||
|
|
||
|
* [MySQL](https://dev.mysql.com/doc/refman/8.0/en/extending-mysql.html)
|
||
|
* [GLib](https://developer.gnome.org/glib/)
|
||
|
|
||
|
## Documentation
|
||
|
|
||
|
* [Writing plugins](https://dev.mysql.com/doc/refman/8.0/en/writing-plugins.html)
|
||
|
* [Authentication plugins](https://dev.mysql.com/doc/refman/8.0/en/writing-authentication-plugins.html)
|
||
|
* [Adding UDF](https://dev.mysql.com/doc/refman/8.0/en/adding-udf.html)
|
||
|
* [GLib API reference](https://developer.gnome.org/glib/)
|