Cool MariaDB Plugins
Click here to load reader
-
Upload
colin-charles -
Category
Technology
-
view
696 -
download
0
Transcript of Cool MariaDB Plugins
![Page 1: Cool MariaDB Plugins](https://reader038.fdocuments.us/reader038/viewer/2022100802/586fe8be1a28ab92198b48bb/html5/thumbnails/1.jpg)
Cool MariaDB PluginsColin Charles
[email protected] http://bytebot.net/blog/ | @bytebot on twitter
http://mariadb.org/ | http://mariadb.com/ MySQL NL User Group, Amsterdam, Netherlands
12 October 2015
![Page 2: Cool MariaDB Plugins](https://reader038.fdocuments.us/reader038/viewer/2022100802/586fe8be1a28ab92198b48bb/html5/thumbnails/2.jpg)
SHOW PLUGINSMariaDB [(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 |
![Page 3: Cool MariaDB Plugins](https://reader038.fdocuments.us/reader038/viewer/2022100802/586fe8be1a28ab92198b48bb/html5/thumbnails/3.jpg)
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
![Page 4: Cool MariaDB Plugins](https://reader038.fdocuments.us/reader038/viewer/2022100802/586fe8be1a28ab92198b48bb/html5/thumbnails/4.jpg)
Getting started
• INSTALL PLUGIN plugin_name SONAME ‘plugin_library.so’
• INSTALL SONAME ‘plugin_library’
• mysql_plugin
• In MariaDB: INFORMATION_SCHEMA.ALL_PLUGINS
![Page 5: Cool MariaDB Plugins](https://reader038.fdocuments.us/reader038/viewer/2022100802/586fe8be1a28ab92198b48bb/html5/thumbnails/5.jpg)
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
![Page 6: Cool MariaDB Plugins](https://reader038.fdocuments.us/reader038/viewer/2022100802/586fe8be1a28ab92198b48bb/html5/thumbnails/6.jpg)
PAM Authentication
• INSTALL SONAME ‘auth_pam';
• CREATE USER username@hostname IDENTIFIED VIA pam;
• Dialog & “cleartext” (for MySQL client libraries)
• 2-factor authentication entirely possible
![Page 7: Cool MariaDB Plugins](https://reader038.fdocuments.us/reader038/viewer/2022100802/586fe8be1a28ab92198b48bb/html5/thumbnails/7.jpg)
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';
![Page 8: Cool MariaDB Plugins](https://reader038.fdocuments.us/reader038/viewer/2022100802/586fe8be1a28ab92198b48bb/html5/thumbnails/8.jpg)
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'
![Page 9: Cool MariaDB Plugins](https://reader038.fdocuments.us/reader038/viewer/2022100802/586fe8be1a28ab92198b48bb/html5/thumbnails/9.jpg)
Audit Plugin• INSTALL PLUGIN server_audit SONAME ‘server_audit';
• server_audit=FORCE_PLUS_PERMANENT
• 5 types of log records: CONNECTION, QUERY, TABLES, QUERY_DDL (filters CREATE, ALTER, etc.), QUERY_DML (filters INSERT, UPDATE, etc.)
• server_audit_events in my.cnf
• User filtering: server_audit_excl_users=monty
![Page 10: Cool MariaDB Plugins](https://reader038.fdocuments.us/reader038/viewer/2022100802/586fe8be1a28ab92198b48bb/html5/thumbnails/10.jpg)
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
![Page 11: Cool MariaDB Plugins](https://reader038.fdocuments.us/reader038/viewer/2022100802/586fe8be1a28ab92198b48bb/html5/thumbnails/11.jpg)
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;
![Page 12: Cool MariaDB Plugins](https://reader038.fdocuments.us/reader038/viewer/2022100802/586fe8be1a28ab92198b48bb/html5/thumbnails/12.jpg)
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
![Page 13: Cool MariaDB Plugins](https://reader038.fdocuments.us/reader038/viewer/2022100802/586fe8be1a28ab92198b48bb/html5/thumbnails/13.jpg)
feedback=ON
![Page 14: Cool MariaDB Plugins](https://reader038.fdocuments.us/reader038/viewer/2022100802/586fe8be1a28ab92198b48bb/html5/thumbnails/14.jpg)
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
![Page 15: Cool MariaDB Plugins](https://reader038.fdocuments.us/reader038/viewer/2022100802/586fe8be1a28ab92198b48bb/html5/thumbnails/15.jpg)
Thanks!Colin Charles
[email protected] http://bytebot.net/blog/ | @bytebot on twitter
http://mariadb.org/ | http://mariadb.com/ MySQL NL User Group, Amsterdam, Netherlands
12 October 2015