1. show create table statements:
Sometime, You want to show create table statements of some tables on command lines,
You can use show table command like this:
1 | mysql> show create table users\G -- "\G" is equal ";" |
2. show table status
Results includes DB Engine, Version, Table Rows Index_length, Au, Collation and so on.
1 | mysql> show table status; |
specify table name:1
2
3
4
5
6
7mysql> show table status where name = "persons";
+---------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+--------------------+----------+----------------+---------+
| 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 |
+---------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+--------------------+----------+----------------+---------+
| Persons | InnoDB | 10 | Dynamic | 0 | 0 | 16384 | 0 | 0 | 0 | NULL | 2017-02-17 02:32:47 | NULL | NULL | utf8mb4_general_ci | NULL | | |
+---------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+--------------------+----------+----------------+---------+
1 row in set (0.00 sec)