This document discusses MariaDB plugins and provides examples of several useful plugins, including authentication plugins, password validation plugins, SQL error logging, audit logging, query analysis, and more. It encourages contributing plugins to help extend MariaDB's functionality.
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
Cool MariaDB Plugins for Authentication, Auditing and More
1. Cool MariaDB Plugins
Colin Charles
colin@mariadb.org
http://bytebot.net/blog/ | @bytebot on twitter
http://mariadb.org/ | http://mariadb.com/
MySQL NL User Group, Amsterdam, Netherlands
12 October 2015
2. SHOW PLUGINS
MariaDB [(none)]> SHOW PLUGINS;
+-------------------------------+----------+--------------------
+------------------------+---------+
| Name | Status | Type | Library
| License |
+-------------------------------+----------+--------------------
+------------------------+---------+
| mysql_native_password | ACTIVE | AUTHENTICATION | NULL
| GPL |
| USER_STATISTICS | ACTIVE | INFORMATION SCHEMA | NULL
| GPL |
| InnoDB | ACTIVE | STORAGE ENGINE | NULL
| GPL |
| QUERY_RESPONSE_TIME_AUDIT | ACTIVE | AUDIT |
query_response_time.so | GPL |
3. Great way to contribute
• MySQL AB
• R.J.Silk, Sergei
Golubchik
• Codership Oy
• Brian Aker,
MySQL AB
• Percona and
Sergei Golubchik
• Oracle
Corporation
• Percona Inc.
• MariaDB
Corporation
• Google Inc
• Sergei Golubchik
• Marc Alff, Oracle
• Monty Program Ab
• Mikael Ronstrom,
MySQL AB
• Roberto Spadim,
Spaempresarial -
Brazil
• Patrick Galbraith
• Alexey Botchkov
• Percona and
Sergey Vojtovich
• Alexey Botchkov
(MariaDB
Corporation)
• Sphinx developers
• Oracle Corp
• Denis Endro eperi
GmbH
• Jonas Oreland
• Tokutek Inc
• Patrick Galbraith
and Brian Aker,
MySQL AB
• higuchi dot akira
at dena dot jp
• Roland Bouman
• Nirbhay Choubey
• Horst Hunger
• Georgi Kodinov
• He Zhenxing
• The Mroonga
project
• Brian Aker
• Kentoku Shiba
4. Getting started
• INSTALL PLUGIN plugin_name SONAME
‘plugin_library.so’
• INSTALL SONAME ‘plugin_library’
• mysql_plugin
• In MariaDB:
INFORMATION_SCHEMA.ALL_PLUGINS
5. auth_socket
• Connect via the Unix socket
• CREATE USER monty IDENTIFIED VIA
unix_socket;
• Debian/Ubuntu use this by default
• Listen to Otto’s talk
6. PAM Authentication
• INSTALL SONAME ‘auth_pam';
• CREATE USER username@hostname
IDENTIFIED VIA pam;
• Dialog & “cleartext” (for MySQL client libraries)
• 2-factor authentication entirely possible
7. Password validation
• INSTALL SONAME
‘simple_password_check.so';
• a password is required to be at least eight
characters, and requires at least one digit, one
uppercase character, one lowercase character,
and one character that is neither a digit nor a
letter.
• INSTALL SONAME
'cracklib_password_check';
8. SQL Error Logging
• Collect errors sent to the client and have it sent to a log file
2015-10-12 13:12:54 msandbox[msandbox] @
localhost [] ERROR 1286: Unknown storage
engine 'AMS' : CREATE TABLE test (id int)
ENGINE=AMS
2015-10-12 13:17:06 msandbox[msandbox] @
localhost [] ERROR 1126: Can't open shared
library '/home/byte/binaries/10.1.7/lib/
plugin/sql_errorlog.so' (errno: 11, cannot
open shared object file: No such file or
directory) : install soname 'sql_errorlog'
10. What’s in the query cache?
• See the contents of the query cache, in the I_S
database, a new QUERY_CACHE_INFO table
• Acquires the query cache lock, so lock waits for
queries using/expiring the cache
11. Query response time
distribution
• Find a large number of queries
that each take a very short
amount of time to execute
• INSTALL SONAME
‘query_response_time';
• SHOW QUERY_RESPONSE_TIME;
• SET GLOBAL
query_response_time_flush
=1;
12. A few more…
• locales - list all compiled-in locales
• metadata_lock_info - show active metadata
locks (lock modes, lock type, and table schema)
• wsrep_info - see WSREP_MEMBERSHIP,
WSREP_STATUS
14. Plugins are cool
• Don’t forget there’s also the enhanced semi-
synchronous replication plugin
• SphinxSE is a pluggable “interface” that’s an
engine that connects to a sphinx daemon for
FTS
• And many engines come in as plugins