MySQL:查看表的状态 show table status


#MySQL 笔记


查看一个数据库中所有表的状态

以数据库 test 为例:

show table status in test;

查看一个数据库中某张表的状态

以数据库test中的表 test_table 为例:

创建表:

use test;
create table test_table (
    c1 CHAR(2)
) engine = InnoDB character set = utf8mb4;

查看状态:

show table status in test where name='test_table' \G

输出:

***************************[ 1. row ]***************************
Name            | test_table
Engine          | InnoDB
Version         | 10
Row_format      | Compact
Rows            | 5
Avg_row_length  | 3276
Data_length     | 16384
Max_data_length | 0
Index_length    | 16384
Data_free       | 0
Auto_increment  | <null>
Create_time     | 2019-01-05 21:24:25
Update_time     | <null>
Check_time      | <null>
Collation       | utf8mb4_general_ci
Checksum        | <null>
Create_options  |
Comment         |

这些列该怎么理解?

列名 介绍
Row_format https://dev.mysql.com/doc/refman/5.6/en/innodb-row-format.html


( 本文完 )