MySQL Utilities (mysqlprocgrep)
Reference: http://thinkit.co.jp/story/2014/02/10/4814
mysqlprocgrep search process information

mysqluc> mysqlprocgrep --help
MySQL Utilities mysqlprocgrep.exe version 1.4.3 (part of MySQL Workbench Distribution 6.0.0)
License type: GPLv2
Usage: mysqlprocgrep.exe --server=user:pass@host:port:socket [options]

mysqlprocgrep - search process information

Options:
  --version             show program's version number and exit
  --help                display a help message and exit
  --license             display program's license and exit
  --server=SERVER       connection information for the server in the form:
                        <user>[:<password>]@<host>[:<port>][:<socket>] or
                        <login-path>[:<port>][:<socket>].
  --character-set=CHARSET
                        sets the client character set. The default is
                        retrieved from the server variable
                        'character_set_client'.
  -G, --basic-regexp, --regexp
                        use 'REGEXP' operator to match pattern. Default is to
                        use 'LIKE'.
  -Q, --print-sql, --sql
                        print the statement instead of sending it to the
                        server. If a kill option is submitted, a procedure
                        will be generated containing the code for executing
                        the kill.
  --sql-body            only print the body of the procedure.
  --kill-connection     kill all matching connections.
  --kill-query          kill query for all matching processes.
  --print               print all matching processes.
  -f FORMAT, --format=FORMAT
                        display the output in either grid (default), tab, csv,
                        or vertical format
  -v, --verbose         control how much information is displayed. e.g., -v =
                        verbose, -vv = more verbose, -vvv = debug
  --match-id=PATTERN    match the 'ID' column of the PROCESSLIST table.
  --match-user=PATTERN  match the 'USER' column of the PROCESSLIST table.
  --match-host=PATTERN  match the 'HOST' column of the PROCESSLIST table.
  --match-db=PATTERN    match the 'DB' column of the PROCESSLIST table.
  --match-command=PATTERN
                        match the 'COMMAND' column of the PROCESSLIST table.
  --match-info=PATTERN  match the 'INFO' column of the PROCESSLIST table.
  --match-state=PATTERN
                        match the 'STATE' column of the PROCESSLIST table.
  --age=AGE             show only processes that have been in the current
                        state more than a given time.

mysqluc>

SQLコマンドの場合

mysql> show full processlist;
+----+------+-----------------+------+---------+------+-------+-----------------------+
| Id | User | Host            | db   | Command | Time | State | Info                  |
+----+------+-----------------+------+---------+------+-------+-----------------------+
| 41 | root | localhost:53225 | test | Query   |    0 | init  | show full processlist |
| 50 | root | localhost:54535 | NULL | Sleep   | 7197 |       | NULL                  |
| 59 | root | localhost:54658 | NULL | Sleep   | 6030 |       | NULL                  |
| 63 | root | localhost:55078 | NULL | Sleep   | 2937 |       | NULL                  |
| 67 | root | localhost:55114 | NULL | Sleep   | 2498 |       | NULL                  |
| 69 | root | localhost:55122 | NULL | Sleep   | 2386 |       | NULL                  |
| 71 | root | localhost:55135 | NULL | Sleep   | 2242 |       | NULL                  |
| 72 | root | localhost:55217 | NULL | Sleep   | 1808 |       | NULL                  |
| 75 | root | localhost:55382 | NULL | Sleep   | 1079 |       | NULL                  |
| 78 | root | localhost:55394 | NULL | Sleep   |  919 |       | NULL                  |
+----+------+-----------------+------+---------+------+-------+-----------------------+
10 rows in set (0.00 sec)

mysql> select * from information_schema.processlist where time >=10;
+----+------+-----------------+------+---------+------+-------+------+
| ID | USER | HOST            | DB   | COMMAND | TIME | STATE | INFO |
+----+------+-----------------+------+---------+------+-------+------+
| 75 | root | localhost:55382 | NULL | Sleep   | 1201 |       | NULL |
| 69 | root | localhost:55122 | NULL | Sleep   | 2508 |       | NULL |
| 78 | root | localhost:55394 | NULL | Sleep   | 1041 |       | NULL |
| 59 | root | localhost:54658 | NULL | Sleep   | 6152 |       | NULL |
| 71 | root | localhost:55135 | NULL | Sleep   | 2364 |       | NULL |
| 67 | root | localhost:55114 | NULL | Sleep   | 2620 |       | NULL |
| 72 | root | localhost:55217 | NULL | Sleep   | 1930 |       | NULL |
| 50 | root | localhost:54535 | NULL | Sleep   | 7319 |       | NULL |
| 63 | root | localhost:55078 | NULL | Sleep   | 3059 |       | NULL |
+----+------+-----------------+------+---------+------+-------+------+
9 rows in set (0.01 sec)

mysql>

MySQL Utilitiesの場合

mysqluc> mysqlprocgrep --server=root:password@localhost:3306 --age=0:10:00
+------------------------+-----+-------+------------------+-------+----------+-------+--------+-------+
| Connection             | Id  | User  | Host             | Db    | Command  | Time  | State  | Info  |
+------------------------+-----+-------+------------------+-------+----------+-------+--------+-------+
| root:*@localhost:3306  | 75  | root  | localhost:55382  | None  | Sleep    | 1155  |        | None  |
| root:*@localhost:3306  | 69  | root  | localhost:55122  | None  | Sleep    | 2462  |        | None  |
| root:*@localhost:3306  | 78  | root  | localhost:55394  | None  | Sleep    | 995   |        | None  |
| root:*@localhost:3306  | 59  | root  | localhost:54658  | None  | Sleep    | 6106  |        | None  |
| root:*@localhost:3306  | 71  | root  | localhost:55135  | None  | Sleep    | 2318  |        | None  |
| root:*@localhost:3306  | 67  | root  | localhost:55114  | None  | Sleep    | 2574  |        | None  |
| root:*@localhost:3306  | 72  | root  | localhost:55217  | None  | Sleep    | 1884  |        | None  |
| root:*@localhost:3306  | 50  | root  | localhost:54535  | None  | Sleep    | 7273  |        | None  |
| root:*@localhost:3306  | 63  | root  | localhost:55078  | None  | Sleep    | 3013  |        | None  |
+------------------------+-----+-------+------------------+-------+----------+-------+--------+-------+

mysqluc>


mysqluc> mysqlprocgrep --server=root:password@localhost:3306 --age=0:10:00 --format=vertical
*************************       1. row *************************
 Connection: root:*@localhost:3306
         Id: 75
       User: root
       Host: localhost:55382
         Db: None
    Command: Sleep
       Time: 1255
      State:
       Info: None
*************************       2. row *************************
 Connection: root:*@localhost:3306
         Id: 69
       User: root
       Host: localhost:55122
         Db: None
    Command: Sleep
       Time: 2562
      State:
       Info: None
*************************       3. row *************************
 Connection: root:*@localhost:3306
         Id: 78
       User: root
       Host: localhost:55394
         Db: None
    Command: Sleep
       Time: 1095
      State:
       Info: None
*************************       4. row *************************
 Connection: root:*@localhost:3306
         Id: 59
       User: root
       Host: localhost:54658
         Db: None
    Command: Sleep
       Time: 6206
      State:
       Info: None
*************************       5. row *************************
 Connection: root:*@localhost:3306
         Id: 71
       User: root
       Host: localhost:55135
         Db: None
    Command: Sleep
       Time: 2418
      State:
       Info: None
*************************       6. row *************************
 Connection: root:*@localhost:3306
         Id: 67
       User: root
       Host: localhost:55114
         Db: None
    Command: Sleep
       Time: 2674
      State:
       Info: None
*************************       7. row *************************
 Connection: root:*@localhost:3306
         Id: 72
       User: root
       Host: localhost:55217
         Db: None
    Command: Sleep
       Time: 1984
      State:
       Info: None
*************************       8. row *************************
 Connection: root:*@localhost:3306
         Id: 50
       User: root
       Host: localhost:54535
         Db: None
    Command: Sleep
       Time: 7373
      State:
       Info: None
*************************       9. row *************************
 Connection: root:*@localhost:3306
         Id: 63
       User: root
       Host: localhost:55078
         Db: None
    Command: Sleep
       Time: 3113
      State:
       Info: None
9 rows.

mysqluc>

Kill Optionを付けると指定した条件の接続をKillする事が出来る。


mysqluc> mysqlprocgrep --server=root:password@localhost:3306 --age=0:10:00 --match-command='Sleep'
+------------------------+-----+-------+------------------+-------+----------+-------+--------+-------+
| Connection             | Id  | User  | Host             | Db    | Command  | Time  | State  | Info  |
+------------------------+-----+-------+------------------+-------+----------+-------+--------+-------+
| root:*@localhost:3306  | 75  | root  | localhost:55382  | None  | Sleep    | 2203  |        | None  |
| root:*@localhost:3306  | 69  | root  | localhost:55122  | None  | Sleep    | 3510  |        | None  |
| root:*@localhost:3306  | 78  | root  | localhost:55394  | None  | Sleep    | 2043  |        | None  |
| root:*@localhost:3306  | 59  | root  | localhost:54658  | None  | Sleep    | 7154  |        | None  |
| root:*@localhost:3306  | 71  | root  | localhost:55135  | None  | Sleep    | 3366  |        | None  |
| root:*@localhost:3306  | 67  | root  | localhost:55114  | None  | Sleep    | 3622  |        | None  |
| root:*@localhost:3306  | 72  | root  | localhost:55217  | None  | Sleep    | 2932  |        | None  |
| root:*@localhost:3306  | 50  | root  | localhost:54535  | None  | Sleep    | 8321  |        | None  |
| root:*@localhost:3306  | 63  | root  | localhost:55078  | None  | Sleep    | 4061  |        | None  |
+------------------------+-----+-------+------------------+-------+----------+-------+--------+-------+
mysqluc>
mysqluc> mysqlprocgrep --server=root:password@localhost:3306 --age=2:10:00 --match-command='Sleep'
+------------------------+-----+-------+------------------+-------+----------+-------+--------+-------+
| Connection             | Id  | User  | Host             | Db    | Command  | Time  | State  | Info  |
+------------------------+-----+-------+------------------+-------+----------+-------+--------+-------+
| root:*@localhost:3306  | 50  | root  | localhost:54535  | None  | Sleep    | 8377  |        | None  |
+------------------------+-----+-------+------------------+-------+----------+-------+--------+-------+
mysqluc> mysqlprocgrep --server=root:password@localhost:3306 --age=2:10:00 --match-command='Sleep' --kill-connection
mysqluc>
mysqluc> mysqlprocgrep --server=root:password@localhost:3306 --age=00:00:00 --match-command='Sleep'
+------------------------+-----+-------+------------------+-------+----------+-------+--------+-------+
| Connection             | Id  | User  | Host             | Db    | Command  | Time  | State  | Info  |
+------------------------+-----+-------+------------------+-------+----------+-------+--------+-------+
| root:*@localhost:3306  | 41  | root  | localhost:53225  | test  | Sleep    | 209   |        | None  |
| root:*@localhost:3306  | 75  | root  | localhost:55382  | None  | Sleep    | 2377  |        | None  |
| root:*@localhost:3306  | 69  | root  | localhost:55122  | None  | Sleep    | 3684  |        | None  |
| root:*@localhost:3306  | 78  | root  | localhost:55394  | None  | Sleep    | 2217  |        | None  |
| root:*@localhost:3306  | 59  | root  | localhost:54658  | None  | Sleep    | 7328  |        | None  |
| root:*@localhost:3306  | 71  | root  | localhost:55135  | None  | Sleep    | 3540  |        | None  |
| root:*@localhost:3306  | 67  | root  | localhost:55114  | None  | Sleep    | 3796  |        | None  |
| root:*@localhost:3306  | 72  | root  | localhost:55217  | None  | Sleep    | 3106  |        | None  |
| root:*@localhost:3306  | 63  | root  | localhost:55078  | None  | Sleep    | 4235  |        | None  |
+------------------------+-----+-------+------------------+-------+----------+-------+--------+-------+

mysqluc> 

複数のプロセスを纏めてKillしようとしたら、Errorになってしまった。
また、時間ある時に確認してみる。


MySQL Utilities (mysqlmetagrep)
Reference: http://thinkit.co.jp/story/2014/02/10/4814
mysqlmetagrep search metadata
DBのメタデータを表示してくれるコマンド

mysqluc> mysqlmetagrep --help
MySQL Utilities mysqlmetagrep.exe version 1.4.3 (part of MySQL Workbench Distribution 6.0.0)
License type: GPLv2
Usage: mysqlmetagrep.exe --server=user:pass@host:port:socket [options] pattern

mysqlmetagrep - search metadata

Options:
  --version             show program's version number and exit
  --help                display a help message and exit
  --license             display program's license and exit
  --server=SERVER       connection information for the server in the form:
                        <user>[:<password>]@<host>[:<port>][:<socket>] or
                        <login-path>[:<port>][:<socket>].
  --character-set=CHARSET
                        sets the client character set. The default is
                        retrieved from the server variable
                        'character_set_client'.
  -b, --body            search the body of routines, triggers, and events as
                        well
  --search-objects=OBJECT_TYPES, --object-types=OBJECT_TYPES
                        the object type to search in: a comma-separated list
                        of one or more of: 'database', 'trigger', 'user',
                        'routine', 'column', 'table', 'partition', 'event',
                        'view'
  -G, --basic-regexp, --regexp
                        use 'REGEXP' operator to match pattern. Default is to
                        use 'LIKE'.
  -p, --print-sql, --sql
                        print the statement instead of sending it to the
                        server
  -e PATTERN, --pattern=PATTERN
                        pattern to use when matching. Required if the pattern
                        looks like a connection specification.
  --database=DATABASE_PATTERN
                        only look at objects in databases matching this
                        pattern
  -f FORMAT, --format=FORMAT
                        display the output in either grid (default), tab, csv,
                        or vertical format

mysqluc>

データベースオブジェクトは、もちろんinformation_schemaをselectすれば確認出来るが、
mysqlmetagrepコマンドを利用しても確認出来る。
運用によっては、色々なケースが考えられるので使い分けても良いかと思います。

SQLコマンドの場合

mysql> select TABLE_SCHEMA,TABLE_NAME,ENGINE,ROW_FORMAT,CREATE_TIME from information_schema.tables where TABLE_TYPE = 'BASE TABLE' and TABLE_SCHEMA like 't%';
+--------------+------------+--------+------------+---------------------+
| TABLE_SCHEMA | TABLE_NAME | ENGINE | ROW_FORMAT | CREATE_TIME         |
+--------------+------------+--------+------------+---------------------+
| test         | db8        | MyISAM | Fixed      | 2014-07-11 16:49:34 |
| test         | language   | InnoDB | Compact    | 2014-07-29 10:23:26 |
| test         | lck        | InnoDB | Compact    | 2014-07-07 17:43:20 |
| test         | montable   | InnoDB | Compact    | 2014-07-23 12:58:38 |
| test         | t          | InnoDB | Compact    | 2014-07-24 15:09:26 |
+--------------+------------+--------+------------+---------------------+
5 rows in set (0.01 sec)

mysql>

MySQL Utilities

mysqluc> mysqlmetagrep --server=root:password@localhost:3306 -e 'test' --database='t%'
+------------------------+--------------+--------------+-----------+-------------+----------+
| Connection             | Object Type  | Object Name  | Database  | Field Type  | Matches  |
+------------------------+--------------+--------------+-----------+-------------+----------+
| root:*@localhost:3306  | SCHEMA       | test         | test      | DATABASE    | test     |
+------------------------+--------------+--------------+-----------+-------------+----------+

mysqluc>

mysqluc> mysqlmetagrep --server=root:password@localhost:3306 -e 't%' --database='t%'
+------------------------+--------------+--------------+-----------+-------------+---------------+
| Connection             | Object Type  | Object Name  | Database  | Field Type  | Matches       |
+------------------------+--------------+--------------+-----------+-------------+---------------+
| root:*@localhost:3306  | SCHEMA       | test         | test      | DATABASE    | test          |
| root:*@localhost:3306  | TABLE        | db8          | test      | COLUMN      | Trigger_priv  |
| root:*@localhost:3306  | TABLE        | t            | test      | TABLE       | t             |
+------------------------+--------------+--------------+-----------+-------------+---------------+

mysqluc>


mysqluc> mysqlmetagrep --server=root:password@localhost:3306 -e 't%' --database='t%' --format=vertical
*************************       1. row *************************
  Connection: root:*@localhost:3306
 Object Type: SCHEMA
 Object Name: test
    Database: test
  Field Type: DATABASE
     Matches: test
*************************       2. row *************************
  Connection: root:*@localhost:3306
 Object Type: TABLE
 Object Name: db8
    Database: test
  Field Type: COLUMN
     Matches: Trigger_priv
*************************       3. row *************************
  Connection: root:*@localhost:3306
 Object Type: TABLE
 Object Name: t
    Database: test
  Field Type: TABLE
     Matches: t
3 rows.

mysqluc>




mysqluc> mysqlmetagrep --server=root:password@localhost:3306 -e 'd%' --database='t%'
+------------------------+--------------+--------------+-----------+-------------+---------------------------+
| Connection             | Object Type  | Object Name  | Database  | Field Type  | Matches                   |
+------------------------+--------------+--------------+-----------+-------------+---------------------------+
| root:*@localhost:3306  | TABLE        | db8          | test      | COLUMN      | Drop_priv,Delete_priv,Db  |
| root:*@localhost:3306  | TABLE        | db8          | test      | TABLE       | db8                       |
+------------------------+--------------+--------------+-----------+-------------+---------------------------+

mysqluc>


mysqluc> mysqlmetagrep --server=root:password@localhost:3306 -e 'd%' --search-objects=table,view --database='t%'
+------------------------+--------------+--------------+-----------+-------------+----------+
| Connection             | Object Type  | Object Name  | Database  | Field Type  | Matches  |
+------------------------+--------------+--------------+-----------+-------------+----------+
| root:*@localhost:3306  | TABLE        | db8          | test      | TABLE       | db8      |
+------------------------+--------------+--------------+-----------+-------------+----------+

mysqluc>


MySQL Utilities (mysqlindexcheck)
Reference: http://thinkit.co.jp/story/2014/02/10/4814
mysqlindexcheck check for duplicate or redundant indexes
不要なIndexを確認して、削除してくれるスクリプトも準備してくれる。

mysqluc> mysqlindexcheck --help
MySQL Utilities mysqlindexcheck.exe version 1.4.3 (part of MySQL Workbench Distribution 6.0.0)
License type: GPLv2
Usage: mysqlindexcheck.exe --server=user:pass@host:port:socket db1.table1 db2 db3.table2

mysqlindexcheck - check for duplicate or redundant indexes

Options:
  --version             show program's version number and exit
  --help                display a help message and exit
  --license             display program's license and exit
  --server=SERVER       connection information for the server in the form:
                        <user>[:<password>]@<host>[:<port>][:<socket>] or
                        <login-path>[:<port>][:<socket>].
  -d, --show-drops      display DROP statements for dropping indexes
  -i, --show-indexes    display indexes for each table
  -s, --skip            skip tables that do not exist
  -f FORMAT, --format=FORMAT
                        display the list of indexes per table in either sql,
                        grid (default), tab, csv, or vertical format
  --stats               show index performance statistics
  --best=BEST           limit index statistics to the best N indexes
  --worst=WORST         limit index statistics to the worst N indexes
  -r, --report-indexes  reports if a table has neither UNIQUE indexes nor a
                        PRIMARY key
  -v, --verbose         control how much information is displayed. e.g., -v =
                        verbose, -vv = more verbose, -vvv = debug

mysqluc>

■既存テーブルの状況確認

mysql> show create table language\G
*************************** 1. row ***************************
       Table: language
Create Table: CREATE TABLE `language` (
  `language_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `name` char(20) NOT NULL,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`language_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)

■意図的に不要なIndexを作成してみる

mysql> create index index_1 on test.language(language_id) using btree;
Query OK, 0 rows affected (0.03 sec)
Records: 0  Duplicates: 0  Warnings: 0

■Indexが出来ている事を確認

mysql> show create table language\G
*************************** 1. row ***************************
       Table: language
Create Table: CREATE TABLE `language` (
  `language_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `name` char(20) NOT NULL,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`language_id`),
  KEY `index_1` (`language_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)

mysql>

■mysqlindexcheckで確認してみる

mysqluc> mysqlindexcheck --server=root:password@localhost:3306 -d test.language;
# Source on localhost: ... connected.
# The following index is a duplicate or redundant for table test.language;:
#
CREATE INDEX `index_1` ON `test`.`language` (`language_id`) USING BTREE
#     may be redundant or duplicate of:
ALTER TABLE `test`.`language` ADD PRIMARY KEY (`language_id`)
#
# DROP statement:
#
ALTER TABLE `test`.`language` DROP INDEX `index_1`;
#
# The following index for table test.language; contains the clustered index and might be redundant:
#
CREATE INDEX `index_1` ON `test`.`language` (`language_id`) USING BTREE
#
# DROP/ADD statement:
#
ALTER TABLE `test`.`language` DROP INDEX `index_1`;
#

mysqluc>

■不要なインデックスがある事が確認出来たので、不要なインデックスを削除する。

mysql> ALTER TABLE `test`.`language` DROP INDEX `index_1`;
Query OK, 0 rows affected (0.01 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> show create table language\G
*************************** 1. row ***************************
       Table: language
Create Table: CREATE TABLE `language` (
  `language_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `name` char(20) NOT NULL,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`language_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)

mysql>

■再度、mysqlindexcheckにて確認すると不要なインデックスが無くなっている事が確認出来た。

mysqluc> mysqlindexcheck --server=root:password@localhost:3306 -d test.language;
# Source on localhost: ... connected.

mysqluc>

余談:Indexの追加、削除はもちろんAlter tableでもCreate Index, Drop IndexでもOKです。

mysql> create index index_1 on test.language(language_id) using btree;
Query OK, 0 rows affected (0.03 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> show create table language\G
*************************** 1. row ***************************
       Table: language
Create Table: CREATE TABLE `language` (
  `language_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `name` char(20) NOT NULL,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`language_id`),
  KEY `index_1` (`language_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)

mysql> drop index index_1 on language;
Query OK, 0 rows affected (0.01 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> show create table language\G
*************************** 1. row ***************************
       Table: language
Create Table: CREATE TABLE `language` (
  `language_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `name` char(20) NOT NULL,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`language_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)

mysql>

MySQL Utilities(mysqlfrm)
MySQL以下にある,FRMファイルからTable作成DDLを作成する。
mysqlfrm show CREATE TABLE from .frm files

スペースの問題なのか、直接MySQLのフォルダー”C:\ProgramData\MySQL\MySQL Server 5.6\data\test\”
からコマンド実行したらエラーになってしまったので、検証用に一時的にシンボリックリンク作成して検証。

C:\ProgramData\MySQL>mklink /d test "C:\ProgramData\MySQL\MySQL Server 5.6\data\test"
test <<===>> C:\ProgramData\MySQL\MySQL Server 5.6\data\test のシンボリック リンクが作成されました

C:\ProgramData\MySQL>

C:\>dir C:\ProgramData\MySQL\test
 ドライブ C のボリューム ラベルは 既定 です
 ボリューム シリアル番号は 14CD-A9DB です

 C:\ProgramData\MySQL\test のディレクトリ

2014/07/29  15:14    <DIR>          .
2014/07/29  15:14    <DIR>          ..
2014/07/11  16:49             9,582 db8.frm
2014/07/29  14:11               440 db8.MYD
2014/07/29  14:11             5,120 db8.MYI
2014/07/29  10:23             8,648 language.frm
2014/07/29  10:23           114,688 language.ibd
2014/07/07  17:43             8,688 lck.frm
2014/07/07  17:55           114,688 lck.ibd
2014/07/23  12:58             8,574 montable.frm
2014/07/23  12:58            98,304 montable.ibd
2014/07/24  15:09             8,556 t.frm
2014/07/24  15:09            98,304 t.ibd
              11 個のファイル             475,592 バイト
               2 個のディレクトリ  137,676,480,512 バイトの空き領域

C:\>

■mysqlfrmの概要

mysqluc> mysqlfrm  --help
MySQL Utilities mysqlfrm.exe version 1.4.3 (part of MySQL Workbench Distribution 6.0.0)
License type: GPLv2
Usage: mysqlfrm.exe --server=[user[:<pass>]@host[:<port>][:<socket>]|<login-path>[:<port>][:<socket>]] [path\tbl1.frm|db:tbl.frm]

mysqlfrm - show CREATE TABLE from .frm files

Options:
  --version             show program's version number and exit
  --license             display program's license and exit
  --help
  --basedir=BASEDIR     the base directory for the server
  --diagnostic          read the frm files byte-by-byte to form the CREATE
                        statement. May require the --server or --basedir
                        options to decipher character set information
  --new-storage-engine=NEW_ENGINE
                        change ENGINE clause to use this engine.
  --frmdir=FRMDIR       save the new .frm files in this directory. Used and
                        valid with --new-storage-engine only.
  --port=PORT           Port to use for the spawned server.
  -s, --show-stats      show file statistics and general table information.
  --server=SERVER       connection information for the server in the form:
                        <user>[:<password>]@<host>[:<port>][:<socket>] or
                        <login-path>[:<port>][:<socket>] (optional) - if
                        provided, the storage engine and character set
                        information will be validated against this server.
  --user=USER           user account to launch spawned server. Required if
                        running as root user. Used only in the default mode.
  --start-timeout=START_TIMEOUT
                        Number of seconds to wait for spawned server to start.
                        Default = 10.
  -v, --verbose         control how much information is displayed. e.g., -v =
                        verbose, -vv = more verbose, -vvv = debug
  -q, --quiet           turn off all messages for quiet execution.

Introduction
------------
The mysqlfrm utility is designed as a recovery tool that reads .frm files and
produces facsimile CREATE statements from the table definition data found in
the .frm file. In most cases, the CREATE statement produced will be usable
for recreating the table on another server or for extended diagnostics.
However, some features are not saved in the .frm files and therefore will be
omitted. The exclusions include but are not limited to:

  - foreign key constraints
  - auto increment number sequences

The mysqlfrm utility has two modes of operation. The default mode is
designed to spawn an instance of an installed server by reference
to the base directory using the --basedir option or by connecting to the
server with the --server option. The process will not alter the original
.frm file(s). This mode also requires the --port option to specify a
port to use for the spawned server. The spawned server will be shutdown
and all temporary files removed after the .frm files are read.

A diagnostic mode is available by using the --diagnostic option. This will
switch the utility to reading the .frm files byte-by-byte to recover as
much information as possible. The diagnostic mode has additional limitations
in that it cannot decipher character set or collation values without using
an existing server installation specified with either the --server or
--basedir option. This can also affect the size of the columns if the table
uses multi-byte characters. Use this mode when the default mode cannot read
the file or if there is no server installed on the host.

To read .frm files, list each file as a separate argument for the utility as
shown in the following examples. You will need to specify the path for each
.frm file you want to read or supply a path to a directory and all of the
.frm files in that directory will be read.

  # Read a single .frm file in the default mode using the server installed
  # in /usr/local/bin/mysql where the .frm file is in the current folder.
  # Notice the use of the db:table.frm format for specifying the database
  # name for the table. The database name appears to the left of ':' and
  # the .frm name to the right. So in this case, we have database = test1
  # and table = db1 so the CREATE statement will read CREATE test1.db1.

  $ mysqlfrm --basedir=/usr/local/bin/mysql test1:db1.frm --port=3333

  # Read multiple .frm files in the default mode using a running server
  # where the .frm files are located in different folders.

  $ mysqlfrm --server=root:pass@localhost:3306 /mysql/data/temp1/t1.frm \
             /mysql/data/temp2/g1.frm --port=3310

  # Execute the spawned server under a different user name and read
  # all of the .frm files in a particular folder in default mode.

  $ mysqlfrm --server=root:pass@localhost:3306 /mysql/data/temp1/t1.frm \
             /mysql/data/temp2/g1.frm --port=3310 --user=joeuser

  # Read all of the .frm files in a particular folder using the diagnostic
  # mode.

  $ mysqlfrm --diagnostic /mysql/data/database1



Helpful Hints
-------------
  - Tables with certain storage engines cannot be read in the default mode.
    These include PARTITION, PERFORMANCE_SCHEMA. You must read these with
    the --diagnostic mode.

  - Use the --diagnostic mode for tables that fail to open correctly
    in the default mode or if there is no server installed on the host.

  - To change the storage engine in the CREATE statement generated for all
    .frm files read, use the --new-storage-engine option

  - To turn off all messages except the CREATE statement and warnings or
    errors, use the --quiet option.

  - Use the --show-stats option to see file statistics for each .frm file.

  - If you encounter connection or similar errors when running in default
    mode, re-run the command with the --verbosity option and view the
    output from the spawned server and repair any errors in launching the
    server. If mysqlfrm fails in the middle, you may need to manually
    shutdown the server on the port specified with --port.

  - If the spawned server takes more than 10 seconds to start, use the
    --start-timeout option to increase the timeout to wait for the
    spawned server to start.

  - If you need to run the utility with elevated privileges, use the --user
    option to execute the spawned server using a normal user account.

  - You can specify the database name to be used in the resulting CREATE
    statement by prepending the .frm file with the name of the database
    followed by a colon. For example, oltp:t1.frm will use 'oltp' for the
    database name in the CREATE statement. The optional database name can
    also be used with paths. For example, /home/me/oltp:t1.frm will use
    'oltp' as the database name. If you leave off the optional database
    name and include a path, the last folder will be the database name.
    For example /home/me/data1/t1.frm will use 'data1' as the database
    name. If you do not want to use the last folder as the database name,
    simply specify the colon like this: /home/me/data1/:t1.frm. In this
    case, the database will be omitted from the CREATE statement.

  - If you use the --new-storage-engine option, you must also provide the
    --frmdir option. When these options are specified, the utility will
    generate a new .frm file (prefixed with 'new_') and save it in the
    --frmdir= directory.

Enjoy!


mysqluc>

■単一ファイルからDDLを作成してみる

mysqluc> mysqlfrm --server=root:Logical06@localhost 'C:\ProgramData\MySQL\test\language.frm' --port=33066
# Source on localhost: ... connected.
# Starting the spawned server on port 3306666 ... done.
# Reading .frm files
#
# Reading the language.frm file.
#
# CREATE statement for C:\ProgramData\MySQL\test\language.frm:
#

CREATE TABLE `test`.`language` (
  `language_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `name` char(20) NOT NULL,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`language_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

#...done.
mysqluc>

■ディレクトリー配下にあるファイルからDDLを作成してみる

mysqluc> mysqlfrm --server=root:Logical06@localhost 'C:\ProgramData\MySQL\test' --port=330666
# Source on localhost: ... connected.
# Starting the spawned server on port 330666 ... done.
# Reading .frm files
#
# Reading the db8.frm file.
#
# CREATE statement for C:\ProgramData\MySQL\test\db8.frm:
#

CREATE TABLE `test`.`db8` (
  `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
  `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
  `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
  `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  `Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  PRIMARY KEY (`Host`,`Db`,`User`),
  KEY `User` (`User`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Database privileges'

#
# Reading the language.frm file.
#
# CREATE statement for C:\ProgramData\MySQL\test\language.frm:
#

CREATE TABLE `test`.`language` (
  `language_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `name` char(20) NOT NULL,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`language_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

#
# Reading the lck.frm file.
#
# CREATE statement for C:\ProgramData\MySQL\test\lck.frm:
#

CREATE TABLE `test`.`lck` (
  `LC_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `first_name` varchar(45) NOT NULL,
  `last_name` varchar(45) NOT NULL,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`LC_id`),
  KEY `idx_actor_last_name` (`last_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

#
# Reading the montable.frm file.
#
# CREATE statement for C:\ProgramData\MySQL\test\montable.frm:
#

CREATE TABLE `test`.`montable` (
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4

#
# Reading the t.frm file.
#
# CREATE statement for C:\ProgramData\MySQL\test\t.frm:
#

CREATE TABLE `test`.`t` (
  `c1` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8

#...done.


MySQL Utilities (mysqldiskusage)
Reference: http://thinkit.co.jp/story/2014/02/10/4814
mysqldiskusage show disk usage for databases

こちらの、コマンドでディスク容量の確認出来ます。
selectでも算出できますが、実際のファイルサイズが確認出来るので
使いようによっては便利かもしれません。

mysqluc> mysqldiskusage --help
MySQL Utilities mysqldiskusage.exe version 1.4.3 (part of MySQL Workbench Distribution 6.0.0)
License type: GPLv2
Usage: mysqldiskusage.exe --server=user:pass@host:port:socket db1 --all

mysqldiskusage - show disk usage for databases

Options:
  --version             show program's version number and exit
  --help                display a help message and exit
  --license             display program's license and exit
  --server=SERVER       connection information for the server in the form:
                        <user>[:<password>]@<host>[:<port>][:<socket>] or
                        <login-path>[:<port>][:<socket>].
  -f FORMAT, --format=FORMAT
                        display the output in either grid (default), tab, csv,
                        or vertical format
  -h, --no-headers      do not show column headers
  -b, --binlog          include binary log usage
  -r, --relaylog        include relay log usage
  -l, --logs            include general and slow log usage
  -i, --innodb          include InnoDB tablespace usage
  -m, --empty           include empty databases
  -a, --all             show all usage including empty databases
  -v, --verbose         control how much information is displayed. e.g., -v =
                        verbose, -vv = more verbose, -vvv = debug
  -q, --quiet           turn off all messages for quiet execution.

mysqluc>


mysqluc> mysqldiskusage --server=root:password@localhost:3306
# Source on localhost: ... connected.
# Database totals:
+---------------------+-------------+
| db_name             |      total  |
+---------------------+-------------+
| copy_test           | 545,285     |
| mysql               | 1,785,056   |
| performance_schema  | 510,023     |
| sakila              | 30,495,478  |
| sys                 | 0           |
| test                | 545,224     |
| world               | 471,349     |
+---------------------+-------------+

Total database disk usage = 34,597,270 bytes or 32.99 MB

#...done.

mysqluc>


mysqluc> mysqldiskusage --server=root:password@localhost:3306 -a
# Source on localhost: ... connected.
# Database totals:
+---------------------+-------------+
| db_name             |      total  |
+---------------------+-------------+
| copy_test           | 545,285     |
| mysql               | 1,785,056   |
| performance_schema  | 510,023     |
| sakila              | 30,495,478  |
| sys                 | 0           |
| test                | 545,224     |
| world               | 471,349     |
+---------------------+-------------+

Total database disk usage = 34,597,270 bytes or 32.99 MB

# Log information.
# general_log information is not accessible. Check your permissions.
# slow_query_log information is not accessible. Check your permissions.
# log_error information is not accessible. Check your permissions.
# Binary log information:
Current binary log file = MySvr-bin.000020
+--------------------+----------+
| log_file           | size     |
+--------------------+----------+
| MySvr-bin.000001  | 143      |
| MySvr-bin.000002  | 4933143  |
| MySvr-bin.000003  | 729      |
| MySvr-bin.000004  | 2225     |
| MySvr-bin.000005  | 143      |
| MySvr-bin.000006  | 630      |
| MySvr-bin.000007  | 3584334  |
| MySvr-bin.000008  | 168      |
| MySvr-bin.000009  | 143      |
| MySvr-bin.000010  | 143      |
| MySvr-bin.000011  | 168      |
| MySvr-bin.000012  | 143      |
| MySvr-bin.000013  | 143      |
| MySvr-bin.000014  | 342      |
| MySvr-bin.000015  | 3482441  |
| MySvr-bin.000016  | 143      |
| MySvr-bin.000017  | 143      |
| MySvr-bin.000018  | 322      |
| MySvr-bin.000019  | 456      |
| MySvr-bin.000020  | 2443     |
| MySvr-bin.index   | 400      |
+--------------------+----------+

Total size of binary logs = 12,008,945 bytes or 11.45 MB

# Server is not an active slave - no relay log information.
# InnoDB tablespace information:
+--------------+-------------+
| innodb_file  |       size  |
+--------------+-------------+
| ib_logfile0  | 50,331,648  |
| ib_logfile1  | 50,331,648  |
| ibdata1      | 79,691,776  |
+--------------+-------------+

Total size of InnoDB files = 180,355,072 bytes or 172.00 MB

#...done.

mysqluc>

MySQL Utilities (mysqldbcopy)
Reference: http://thinkit.co.jp/story/2014/02/10/4814
mysqldbcopy copy databases from one server to another

DB全体をコピーする為のコマンド
もちろんDump&Restoreでも可能だが、場合によっては簡単にコピー出来るので
検証環境にデータコピーするなどに便利かと。(個人情報等を含む場合は、データの入れ替えが必要だが..)

mysqluc> mysqldbcopy --help
MySQL Utilities mysqldbcopy.exe version 1.4.3 (part of MySQL Workbench Distribution 6.0.0)
License type: GPLv2
Usage: mysqldbcopy.exe --source=user:pass@host:port:socket --destination=user:pass@host:port:socket orig_db:new_db

mysqldbcopy - copy databases from one server to another

Options:
  --version             show program's version number and exit
  --help                display a help message and exit
  --license             display program's license and exit
  --source=SOURCE       connection information for source server in the form:
                        <user>[:<password>]@<host>[:<port>][:<socket>] or
                        <login-path>[:<port>][:<socket>].
  --destination=DESTINATION
                        connection information for destination server in the
                        form: <user>[:<password>]@<host>[:<port>][:<socket>]
                        or <login-path>[:<port>][:<socket>].
  --character-set=CHARSET
                        sets the client character set. The default is
                        retrieved from the server variable
                        'character_set_client'.
  -d, --drop-first      drop the new database or object if it exists
  -x EXCLUDE, --exclude=EXCLUDE
                        exclude one or more objects from the operation using
                        either a specific name (e.g. db1.t1), a LIKE pattern
                        (e.g. db1.t% or db%.%) or a REGEXP search pattern. To
                        use a REGEXP search pattern for all exclusions, you
                        must also specify the --regexp option. Repeat the
                        --exclude option for multiple exclusions.
  -a, --all             include all databases
  --skip=SKIP_OBJECTS   specify objects to skip in the operation in the form
                        of a comma-separated list (no spaces). Valid values =
                        tables, views, triggers, procedures, functions,
                        events, grants, data, create_db
  -v, --verbose         control how much information is displayed. e.g., -v =
                        verbose, -vv = more verbose, -vvv = debug
  -q, --quiet           turn off all messages for quiet execution.
  --new-storage-engine=NEW_ENGINE
                        change all tables to use this storage engine if
                        storage engine exists on the destination.
  --default-storage-engine=DEF_ENGINE
                        change all tables to use this storage engine if the
                        original storage engine does not exist on the
                        destination.
  --locking=LOCKING     choose the lock type for the operation: no-locks = do
                        not use any table locks, lock-all = use table locks
                        but no transaction and no consistent read, snaphot
                        (default): consistent read using a single transaction.
  -G, --basic-regexp, --regexp
                        use 'REGEXP' operator to match pattern. Default is to
                        use 'LIKE'.
  --rpl-user=RPL_USER   the user and password for the replication user
                        requirement, in the form: <user>[:<password>] or
                        <login-path>. E.g. rpl:passwd - By default = none
  --rpl=RPL_MODE, --replication=RPL_MODE
                        include replication information. Choices: 'master' =
                        include the CHANGE MASTER command using the source
                        server as the master, 'slave' = include the CHANGE
                        MASTER command for the source server's master (only
                        works if the source server is a slave).
  --skip-gtid           skip creation and execution of GTID statements during
                        copy.
  --multiprocess=MULTIPROCESS
                        use multiprocessing, number of processes to use for
                        concurrent execution. Special values: 0 (number of
                        processes equal to the CPUs detected) and 1 (default -
                        no concurrency).

mysqluc>

■データコピー前の確認とデータコピー後の確認

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sakila             |
| sys                |
| test               |
| world              |
+--------------------+
7 rows in set (0.00 sec)

mysql> 
mysqluc> mysqldbcopy --source=root:password@localhost --destination=root:password@localhost test:copy_test
# Source on localhost: ... connected.
# Destination on localhost: ... connected.
# Copying database test renamed as copy_test
# Copying TABLE test.db8
# Copying TABLE test.language
# Copying TABLE test.lck
# Copying TABLE test.montable
# Copying TABLE test.t
# Copying data for TABLE test.db8
# Copying data for TABLE test.language
# Copying data for TABLE test.lck
# Copying data for TABLE test.montable
# Copying data for TABLE test.t
#...done.

mysqluc>

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| copy_test          |
| mysql              |
| performance_schema |
| sakila             |
| sys                |
| test               |
| world              |
+--------------------+
8 rows in set (0.00 sec)

mysql>

■データベースオブジェクトやデータの確認

mysql> use test
Database changed
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| db8            |
| language       |
| lck            |
| montable       |
| t              |
+----------------+
5 rows in set (0.00 sec)

mysql> select count(*) from language;
+----------+
| count(*) |
+----------+
|        6 |
+----------+
1 row in set (0.00 sec)

mysql> use copy_test
Database changed
mysql> show tables;
+---------------------+
| Tables_in_copy_test |
+---------------------+
| db8                 |
| language            |
| lck                 |
| montable            |
| t                   |
+---------------------+
5 rows in set (0.00 sec)

mysql> select count(*) from language;
+----------+
| count(*) |
+----------+
|        6 |
+----------+
1 row in set (0.00 sec)

mysql>

■リモートサーバーにコピーした時など、mysqldiffやmysqldbcompareを利用してDBが同じかどうか確認出来る。

mysqluc> mysqldiff --help
MySQL Utilities mysqldiff.exe version 1.4.3 (part of MySQL Workbench Distribution 6.0.0)
License type: GPLv2
Usage: mysqldiff.exe --server1=user:pass@host:port:socket --server2=user:pass@host:port:socket db1.object1:db2.object1 db3:db4

mysqldiff - compare object definitions among objects where the difference is
how db1.obj1 differs from db2.obj2

Options:
  --version             show program's version number and exit
  --help                display a help message and exit
  --license             display program's license and exit
  --server1=SERVER1     connection information for first server in the form:
                        <user>[:<password>]@<host>[:<port>][:<socket>] or
                        <login-path>[:<port>][:<socket>].
  --server2=SERVER2     connection information for second server in the form:
                        <user>[:<password>]@<host>[:<port>][:<socket>] or
                        <login-path>[:<port>][:<socket>].
  --character-set=CHARSET
                        sets the client character set. The default is
                        retrieved from the server variable
                        'character_set_client'.
  --width=WIDTH         display width
  --force               do not abort when a diff test fails
  -c, --compact         compact output from a diff.
  --skip-table-options  skip check of all table options (e.g., AUTO_INCREMENT,
                        ENGINE, CHARSET, etc.).
  -v, --verbose         control how much information is displayed. e.g., -v =
                        verbose, -vv = more verbose, -vvv = debug
  -q, --quiet           turn off all messages for quiet execution.
  -d DIFFTYPE, --difftype=DIFFTYPE
                        display differences in context format in one of the
                        following formats: [unified|context|differ|sql]
                        (default: unified).
  --changes-for=CHANGES_FOR
                        specify the server to show transformations to match
                        the other server. For example, to see the
                        transformation for transforming server1 to match
                        server2, use --changes-for=server1. Valid values are
                        'server1' or 'server2'. The default is 'server1'.
  --show-reverse        produce a transformation report containing the SQL
                        statements to transform the object definitions
                        specified in reverse. For example if --changes-for is
                        set to server1, also generate the transformation for
                        server2. Note: the reverse changes are annotated and
                        marked as comments.

mysqluc>
mysqluc> mysqldbcompare --help
MySQL Utilities mysqldbcompare.exe version 1.4.3 (part of MySQL Workbench Distribution 6.0.0)
License type: GPLv2
Usage: mysqldbcompare.exe --server1=user:pass@host:port:socket --server2=user:pass@host:port:socket db1:db2

mysqldbcompare - compare databases for consistency

Options:
  --version             show program's version number and exit
  --help                display a help message and exit
  --license             display program's license and exit
  --server1=SERVER1     connection information for first server in the form:
                        <user>[:<password>]@<host>[:<port>][:<socket>] or
                        <login-path>[:<port>][:<socket>].
  --server2=SERVER2     connection information for second server in the form:
                        <user>[:<password>]@<host>[:<port>][:<socket>] or
                        <login-path>[:<port>][:<socket>].
  --character-set=CHARSET
                        sets the client character set. The default is
                        retrieved from the server variable
                        'character_set_client'.
  -f FORMAT, --format=FORMAT
                        display the output in either grid (default), tab, csv,
                        or vertical format
  --skip-checksum-table
                        skip CHECKSUM TABLE step in data consistency check.
  --skip-object-compare
                        skip object comparison step.
  --skip-row-count      skip row count step.
  --skip-diff           skip the object diff step.
  --skip-data-check     skip data consistency check.
  --skip-table-options  skip check of all table options (e.g., AUTO_INCREMENT,
                        ENGINE, CHARSET, etc.).
  --width=WIDTH         display width
  -a, --run-all-tests   do not abort when a diff test fails
  -c, --compact         compact output from a diff.
  --disable-binary-logging
                        turn binary logging off during operation if enabled
                        (SQL_LOG_BIN=1). Note: may require SUPER privilege.
                        Prevents compare operations from being written to the
                        binary log.
  --span-key-size=SPAN_KEY_SIZE
                        changes the size of the key used for compare table
                        contents. A higher value can help to get more accurate
                        results comparing large databases, but may slow the
                        algorithm. Default value is 8.
  --use-indexes=USE_INDEXES
                        for each table, indicate which index to use as if were
                        a primary key (each of his columns must not allow null
                        values).
  -v, --verbose         control how much information is displayed. e.g., -v =
                        verbose, -vv = more verbose, -vvv = debug
  -q, --quiet           turn off all messages for quiet execution.
  -d DIFFTYPE, --difftype=DIFFTYPE
                        display differences in context format in one of the
                        following formats: [unified|context|differ|sql]
                        (default: unified).
  --changes-for=CHANGES_FOR
                        specify the server to show transformations to match
                        the other server. For example, to see the
                        transformation for transforming server1 to match
                        server2, use --changes-for=server1. Valid values are
                        'server1' or 'server2'. The default is 'server1'.
  --show-reverse        produce a transformation report containing the SQL
                        statements to transform the object definitions
                        specified in reverse. For example if --changes-for is
                        set to server1, also generate the transformation for
                        server2. Note: the reverse changes are annotated and
                        marked as comments.

mysqluc>