MySQL Utilities

Abstract

This is the MySQL™ Utilities Reference Manual. It documents both the GPL and commercial editions of the MySQL Utilities 1.5 release series through 1.5.6.

If you have not yet installed MySQL Utilities please download your free copy from the download site. MySQL Utilities is available for Windows, OS X, and Linux variants.

For notes detailing the changes in each release, see the MySQL Utilities Release Notes.

For legal information, see the Legal Notices.

For help with using MySQL, please visit either the MySQL Forums or MySQL Mailing Lists, where you can discuss your issues with other MySQL users.

For additional documentation on MySQL products, including translations of the documentation into other languages, and downloadable versions in variety of formats, including HTML and PDF formats, see the MySQL Documentation Library.

Licensing information.  This product may include third-party software, used under license. If you are using a Commercial release of MySQL Utilities, see this document for licensing information, including licensing information relating to third-party software that may be included in this Commercial release. If you are using a Community release of MySQL Utilities, see this document for licensing information, including licensing information relating to third-party software that may be included in this Community release.

Document generated on: 2016-09-16 (revision: 49023)


Table of Contents

Preface
1 How to Install MySQL Utilities
1.1 Prerequisites
1.2 Source Code
1.3 Oracle Linux and Red Hat Linux 6
1.4 Debian Linux
1.5 Microsoft Windows
1.6 OS X
2 Introduction
2.1 Introduction to MySQL Utilities
2.2 Connecting to MySQL Servers
2.2.1 Connection Parameters
2.2.2 Specifying Connections in Python Library
3 MySQL Utilities Administrative Tasks
3.1 Database Operations
3.1.1 How do you provision a slave?
3.1.2 How do you make a copy of a database on the same server?
3.1.3 How can you make a copy of a database and change the storage engine?
3.1.4 How do you tell if a table on server A has the same structure as the same table on server B?
3.1.5 How do you synchronize a table on two servers where neither is up-to-date?
3.2 General Operations
3.2.1 How do you know how much space your data uses?
3.2.2 How do you recover the CREATE statement from a damaged or offline server?
3.2.3 How do you create a new user with the same privileges as another user?
3.2.4 Is there an easy way to know what options are used with each utility?
3.2.5 How do you find redundant or duplicate indexes and know which ones to drop?
3.2.6 How do you find all objects that start with a given name prefix?
3.2.7 How do you run a process every night to kill certain connections?
3.3 High Availability Operations
3.3.1 How do you setup and use replication?
3.3.2 How do you add new servers to an existing topology and change the master role?
3.3.3 How do you setup and use automatic failover?
3.3.4 How do you restore the previous master to service after failover?
3.3.5 How do you find all of the slaves attached to a master server?
3.3.6 How Can you determine if data was replicated correctly?
3.3.7 How do you fix errant transactions on the replication topology?
3.4 Server Operations
3.4.1 How can you create a temporary copy (running instance) of a server for testing?
3.4.2 How do you find what MySQL servers are running on a local machine?
3.4.3 How do you setup and use a secure (encrypted) connection between Utilities and a MySQL server?
3.5 Specialized Operations
3.5.1 How do you record only login events in the audit log?
3.5.2 How do you copy or move the audit log?
3.5.3 How can you find the INSERT and UPDATE queries that failed in the audit log?
3.5.4 How do you find connections by the user 'root' in the audit log and show the results in CSV format?
4 Overview of MySQL Utilities
4.1 Database Operations
4.2 General Operations
4.3 High Availability Operations
4.4 Server Operations
4.5 Specialized Operations
5 Manual Pages
5.1 mysqlauditadmin — Allows users to perform maintenance actions on the audit log
5.2 mysqlauditgrep — Allows users to search the current or an archived audit log
5.3 mysqldbcompare — Compare Two Databases and Identify Differences
5.4 mysqldbcopy — Copy Database Objects Between Servers
5.5 mysqldbexport — Export Object Definitions or Data from a Database
5.6 mysqldbimport — Import Object Definitions or Data into a Database
5.7 mysqldiff — Identify Differences Among Database Objects
5.8 mysqldiskusage — Show Database Disk Usage
5.9 mysqlfailover — Automatic replication health monitoring and failover
5.10 mysqlfrm — File reader for .frm files.
5.11 mysqlindexcheck — Identify Potentially Redundant Table Indexes
5.12 mysqlmetagrep — Search Database Object Definitions
5.13 mysqlprocgrep — Search Server Process Lists
5.14 mysqlreplicate — Set Up and Start Replication Between Two Servers
5.15 mysqlrplms — Set Up and Start Replication from a Slave to Multiple Masters
5.16 mysqlrpladmin — Administration utility for MySQL replication
5.17 mysqlrplcheck — Check Replication Prerequisites
5.18 mysqlrplshow — Show Slaves for Master Server
5.19 mysqlrplsync — Replication synchronization checker
5.20 mysqlserverclone — Clone Existing Server to Create New Server
5.21 mysqlserverinfo — Display Common Diagnostic Information from a Server
5.22 mysqluc — Command line client for running MySQL Utilities
5.23 mysqluserclone — Clone Existing User to Create New User
6 Extending MySQL Utilities
6.1 Introduction to extending the MySQL Utilities
6.2 MySQL Utilities copy_server.py sample
6.3 Specialized Operations
6.3.1 mysql.utilities.command.grep — Search Databases for Objects
6.3.2 mysql.utilities.command.proc — Search Processes on Servers
6.4 Parsers
6.4.1 mysql.utilities.parser — Parse MySQL Log Files
7 MySQL Utilities Testing (MUT)
7.1 mut — MySQL Utilities Testing
8 MySQL Fabric
8.1 Introduction to Fabric
8.1.1 Fabric Prerequisites
8.1.2 Fabric Concepts
8.2 Installing and Configuring MySQL Fabric
8.2.1 Downloading MySQL Fabric
8.2.2 Installing MySQL Fabric
8.2.3 Configuring MySQL Fabric
8.2.4 Starting and Stopping MySQL Fabric Nodes
8.2.5 Old Configuration System
8.3 Quick Start
8.3.1 Example: Fabric and Replication
8.3.2 Example: Fabric and Sharding
8.4 The mysqlfabric Utility
8.4.1 Getting Help
8.4.2 Dump Commands
8.4.3 Event Commands
8.4.4 Group Commands
8.4.5 Manage Commands
8.4.6 Provider Commands
8.4.7 Role Commands
8.4.8 Server Commands
8.4.9 Sharding Commands
8.4.10 Snapshot Commands
8.4.11 Statistics Commands
8.4.12 Threat Commands
8.4.13 User Commands
8.5 Fabric Utility Command Matrix
8.6 Backing Store
8.6.1 Backing Store Tables
8.6.2 Protecting the Backing Store
8.7 Using MySQL Fabric with Pacemaker and Corosync
8.7.1 Introduction
8.7.2 Pre-requisites
8.7.3 Target Configuration
8.7.4 Setting up and testing your system
8.7.5 Key administrative tasks
8.8 Using Connector/Python with MySQL Fabric
8.8.1 Installing Connector/Python with MySQL Fabric Support
8.8.2 Requesting a Fabric Connection
8.8.3 Providing Information to Choose a MySQL Server
8.9 Using Connector/J with MySQL Fabric
8.9.1 Installing Connector/J with MySQL Fabric Support
8.9.2 Loading the Driver and Requesting a Fabric Connection
8.9.3 Providing Information to Choose a MySQL Server
8.9.4 MySQL Fabric Configuration for Running Samples
8.9.5 Running Tests
8.9.6 Running Demonstration Programs
8.9.7 A Complete Example: Working with Employee Data
8.9.8 How Connector/J Chooses a MySQL Server
8.9.9 Using Hibernate with MySQL Fabric
8.9.10 Connector/J Fabric Support Reference
8.10 MySQL Fabric Frequently Asked Questions
9 Appendix
9.1 MySQL Utilities Frequently Asked Questions