テーブルの詳細情報を知りたい場合は、”show table status”を実行します。
選択されているデータベース内のすべてのテーブルの情報を表示する場合
1 2 3 4 5 6 7 |
mysql> show table status; +-------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-------------------+----------+----------------+---------+ | Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment | +-------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-------------------+----------+----------------+---------+ | test | MyISAM | 10 | Dynamic | 7 | 20 | 140 | 281474976710655 | 2048 | 0 | 8 | 2012-12-18 13:14:04 | 2012-12-18 13:36:02 | NULL | latin1_swedish_ci | NULL | | | | test2 | MyISAM | 10 | Dynamic | 1 | 20 | 20 | 281474976710655 | 2048 | 0 | 2 | 2012-12-18 13:42:14 | 2012-12-18 13:47:02 | NULL | utf8_general_ci | NULL | | | +-------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-------------------+----------+----------------+---------+ |
選択されているデータベース内の特定のテーブルを表示する場合
1 2 3 4 5 6 |
mysql> show table status like 'test2'; +-------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------------+----------+----------------+---------+ | Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment | +-------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------------+----------+----------------+---------+ | test2 | MyISAM | 10 | Dynamic | 1 | 20 | 20 | 281474976710655 | 2048 | 0 | 2 | 2012-12-18 13:42:14 | 2012-12-18 13:47:02 | NULL | utf8_general_ci | NULL | | | +-------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------------+----------+----------------+---------+ |
データベースを指定する場合
1 2 3 4 5 6 7 |
mysql> show table status from mysql like 'user'; +------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------+----------+----------------+-----------------------------+ | Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment | +------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------+----------+----------------+-----------------------------+ | user | MyISAM | 10 | Dynamic | 17 | 65 | 1108 | 281474976710655 | 2048 | 0 | NULL | 2008-07-28 11:29:02 | 2012-12-06 08:34:32 | NULL | utf8_bin | NULL | | Users and global privileges | +------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------+----------+----------------+-----------------------------+ 1 row in set (0.00 sec) |
/