• このエントリーをはてなブックマークに追加

メモ

MySQL内に作られたテーブルやそのストレージエンジンの種類を確認するには,データベース information_schema のテーブル TABLES をチェックすればいいみたい.

root@localhost:(none) > use information_schema;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
 
Database changed
root@localhost:information_schema > desc TABLES;
+-----------------+---------------------+------+-----+---------+-------+
| Field           | Type                | Null | Key | Default | Extra |
+-----------------+---------------------+------+-----+---------+-------+
| TABLE_CATALOG   | varchar(512)        | NO   |     |         |       |
| TABLE_SCHEMA    | varchar(64)         | NO   |     |         |       |
| TABLE_NAME      | varchar(64)         | NO   |     |         |       |
| TABLE_TYPE      | varchar(64)         | NO   |     |         |       |
| ENGINE          | varchar(64)         | YES  |     | NULL    |       |
| VERSION         | bigint(21) unsigned | YES  |     | NULL    |       |
| ROW_FORMAT      | varchar(10)         | YES  |     | NULL    |       |
| TABLE_ROWS      | bigint(21) unsigned | YES  |     | NULL    |       |
| AVG_ROW_LENGTH  | bigint(21) unsigned | YES  |     | NULL    |       |
| DATA_LENGTH     | bigint(21) unsigned | YES  |     | NULL    |       |
| MAX_DATA_LENGTH | bigint(21) unsigned | YES  |     | NULL    |       |
| INDEX_LENGTH    | bigint(21) unsigned | YES  |     | NULL    |       |
| DATA_FREE       | bigint(21) unsigned | YES  |     | NULL    |       |
| AUTO_INCREMENT  | bigint(21) unsigned | YES  |     | NULL    |       |
| CREATE_TIME     | datetime            | YES  |     | NULL    |       |
| UPDATE_TIME     | datetime            | YES  |     | NULL    |       |
| CHECK_TIME      | datetime            | YES  |     | NULL    |       |
| TABLE_COLLATION | varchar(32)         | YES  |     | NULL    |       |
| CHECKSUM        | bigint(21) unsigned | YES  |     | NULL    |       |
| CREATE_OPTIONS  | varchar(255)        | YES  |     | NULL    |       |
| TABLE_COMMENT   | varchar(2048)       | NO   |     |         |       |
+-----------------+---------------------+------+-----+---------+-------+
21 rows in set (0.08 sec)
 
root@localhost:information_schema > select TABLE_SCHEMA, TABLE_NAME, ENGINE
    ->  from TABLES where TABLE_SCHEMA = 'test';
+--------------+------------+---------+
| TABLE_SCHEMA | TABLE_NAME | ENGINE  |
+--------------+------------+---------+
| test         | aaa        | MyISAM  |
| test         | baz        | groonga |
| test         | foo        | groonga |
| test         | foobar     | MyISAM  |
| test         | fuga       | MyISAM  |
| test         | hoge       | MyISAM  |
| test         | sessions   | MyISAM  |
| test         | t          | groonga |
+--------------+------------+---------+
8 rows in set (0.00 sec)