Book Image

MariaDB Cookbook

By : Daniel Bartholomew
Book Image

MariaDB Cookbook

By: Daniel Bartholomew

Overview of this book

Table of Contents (20 chapters)
MariaDB Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Migrating to TokuDB


TokuDB doesn't do us any good if we don't use it. Migrating existing tables to TokuDB, whether they are MyISAM, Aria, or InnoDB/XtraDB, is fairly painless.

Getting ready

Import the ISFDB database as described in the Importing the data exported by mysqldump recipe in Chapter 2, Diving Deep into MariaDB.

How to do it...

Follow the ensuing steps:

  1. Launch the mysql command-line client and connect to the isfdb database.

  2. Alter the pub% tables to be TokuDB tables:

    ALTER TABLE pub_authors ENGINE=TokuDB;
    ALTER TABLE pub_content ENGINE=TokuDB;
    ALTER TABLE pub_series ENGINE=TokuDB;
    ALTER TABLE publishers ENGINE=TokuDB;
    
  3. Run SHOW CREATE TABLE on each of the tables to verify that they now have ENGINE=TokuDB after the data definition section. Using the publishers table as an example, we get the following output:

  4. Convert additional tables in the isfdb database to TokuDB format if required.

How it works...

The ALTER TABLE statement works in three stages. It first creates a new table using the new...