Maatkit has become part of Percona Toolkit, and there will be no further development or releases of Maatkit separately from Percona Toolkit.

If you’re not familiar with Maatkit, this page might help.  Maatkit has such rich functionality that it’s hard to describe in one short page, but we’ll try to point you in the right direction.

General Overview

Maatkit tools try to make complicated tasks simpler and more reliable.  Most of these tasks involve something like gluing together difficult commands inside MySQL.  Most of the tools try to do something useful by default.  Some of them are only for advanced power users who really know what they’re doing.  All of the tools go to great lengths to be careful and safe with your data, sometimes to the point that users think there’s a bug when they’re really seeing unexpected behavior that protects them from some obscure problem they didn’t think of.


Replication in MySQL seems simple, but there’s much more depth than you’d expect.  Maatkit has many tools that are centered around replication.  Here’s some of what you can do:

  • Check that your slaves are the same as the masters: mk-table-checksum
  • Synchronize slaves to their masters: mk-table-sync
  • Delay a slave for safety: mk-slave-delay
  • Speed up a slave: mk-slave-prefetch
  • Check how far behind a slave is: mk-heartbeat
  • Restart a slave that has stopped due to an error: mk-slave-restart
  • Find slaves attached to a master, and print them: mk-slave-find
  • Move servers around in the replication hierarchy: mk-slave-move

Data Archiving, Importing, and Exporting

  • Archive or purge data efficiently and without blocking online operations: mk-archiver
  • Export or import data in many threads simultaneously: mk-parallel-dump and mk-parallel-import

Log Analysis and Replay

  • Analyze a MySQL slow  query log or general query log: mk-query-digest
  • Filter, transform, aggregate, and re-execute queries: mk-query-digest
  • Capture and analyze TCP traffic from MySQL, HTTP, or Memcached: mk-query-digest
  • Analyze PostgreSQL log files: mk-query-digest
  • Analyze an error log: mk-error-log
  • Log InnoDB deadlocks: mk-deadlock-logger
  • Log InnoDB foreign key errors: mk-fk-error-logger
  • Re-execute queries to generate load against a server: mk-log-player
  • Execute queries against two servers and compare the results to test for upgrade problems: mk-upgrade

Analyzing Queries, Schema, and Settings

  • We’re currently building a suite of mk-advisor tools to help you analyze queries, schema, and settings for problems.

Making Hard Things Easy

  • Format EXPLAIN so you can understand it: mk-visual-explain
  • Export GRANT statements in a nice way: mk-show-grants
  • Execute queries and profile their STATUS counters: mk-query-profiler
  • Watch a server and do something when a condition is true: mk-loadavg
  • Watch a server and kill undesired queries: mk-kill
  • Find tables and execute actions on them: mk-find
  • Find duplicate indexes and foreign keys: mk-duplicate-key-checker
  • Make a single huge appear to be many small files: mk-fifo-split