PacktLib: MariaDB Cookbook

MariaDB Cookbook

Credits

About the Author

About the Reviewers

www.PacktPub.com

Preface

Getting Started with MariaDB

Introduction

Installing MariaDB on Windows

Installing MariaDB on Linux

Installing MariaDB on Mac OS X

Enabling the Feedback plugin

Switching between InnoDB and XtraDB

Creating a backup user

Making backups with XtraBackup

Making backups with mysqldump

Checking and optimizing tables automatically with mysqlcheck and cron

Using progress reporting in the mysql client

Diving Deep into MariaDB

Introduction

Importing the data exported by mysqldump

Using SHOW EXPLAIN with running queries

Using LIMIT ROWS EXAMINED

Using INSTALL SONAME

Producing HTML output

Producing XML output

Migrating a table from MyISAM to Aria

Migrating a table from MyISAM or Aria to InnoDB or XtraDB

Optimizing and Tuning MariaDB

Introduction

Using SHOW STATUS to check if a feature is being used

Controlling MariaDB optimizer strategies

Using extended keys with InnoDB and XtraDB

Configuring the Aria two-step deadlock detection

Configuring the MyISAM segmented key cache

Configuring threadpool

Configuring the Aria pagecache

Optimizing queries with the subquery cache

Optimizing semijoin subqueries

Creating an index

Creating a full-text index

Removing an index

Using JOINs

Using microseconds in the DATETIME columns

Updating DATETIME and TIMESTAMP columns automatically

The TokuDB Storage Engine

Introduction

Installing TokuDB

Configuring TokuDB

Creating TokuDB tables

Migrating to TokuDB

Adding indexes to TokuDB tables

Modifying the compression of a TokuDB table

The CONNECT Storage Engine

Introduction

Installing the CONNECT storage engine

Creating and dropping CONNECT tables

Reading and writing CSV data using CONNECT

Reading and writing XML data using CONNECT

Accessing MariaDB tables using CONNECT

Using the XCOL table type

Using the PIVOT table type

Using the OCCUR table type

Using the WMI table type

Using the MAC address table type

Replication in MariaDB

Introduction

Setting up replication

Using global transaction IDs

Using multisource replication

Enhancing the binlog with row event annotations

Configuring binlog event checksums

Selectively skipping the replication of binlog events

Replication with MariaDB Galera Cluster

Introduction

Installing MariaDB Galera Cluster

Dropping a node from MariaDB Galera Cluster

Shutting down MariaDB Galera Cluster

Performance and Usage Statistics

Introduction

Installing the Audit Plugin

Using the Audit Plugin

Using engine-independent table statistics

Using extended statistics

Enabling the performance schema

Using the performance schema

Searching Data Using Sphinx

Introduction

Installing SphinxSE in MariaDB

Installing the Sphinx daemon on Linux

Installing the Sphinx daemon on Windows

Configuring the Sphinx daemon

Searching with the Sphinx daemon and SphinxSE

Exploring Dynamic and Virtual Columns in MariaDB

Introduction

Creating tables with dynamic columns

Inserting, updating, and deleting dynamic column data

Reading data from a dynamic column

Using virtual columns

NoSQL with HandlerSocket

Introduction

Installing and configuring HandlerSocket

Installing the libhsclient library

Installing the HandlerSocket PERL client libraries

Reading data using HandlerSocket and PERL

Inserting data using HandlerSocket and PERL

Updating and deleting data using HandlerSocket and PERL

Installing the HandlerSocket Python client libraries

Reading data using HandlerSocket and Python

Inserting data using HandlerSocket and Python

Updating and deleting data using HandlerSocket and Python

Installing the HandlerSocket Ruby client libraries

Reading data using HandlerSocket and Ruby

Inserting data using HandlerSocket and Ruby

Updating and deleting data using HandlerSocket and Ruby

Using HandlerSocket directly with Telnet

NoSQL with the Cassandra Storage Engine

Introduction

Installing the Cassandra storage engine

Mapping data between MariaDB and Cassandra

Using INSERT, UPDATE, and DELETE with the Cassandra storage engine

Using SELECT with the Cassandra storage engine

MariaDB Security

Introduction

Securing MariaDB with mysql_secure_installation

Securing MariaDB files on Linux

Securing MariaDB files on Windows

Checking for users with insecure passwords

Encrypting connections with SSL

Using roles to control user permissions

Authenticating using the PAM authentication plugin

Index