MySQL/SHOW:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
Kangkk​(留言 | 贡献)
小 Kangkk移动页面Mysql/SHOW至MySQL/SHOW,不留重定向
 
(未显示同一用户的4个中间版本)
第32行: 第32行:
== 表状态 ==
== 表状态 ==
{{Shc_out|<syntaxhighlight lang="mysql">
{{Shc_out|<syntaxhighlight lang="mysql">
SHOW TABLE STATUS WHERE Name = 'user';</syntaxhighlight>|<syntaxhighlight lang="bash">
SHOW TABLE STATUS WHERE Name = 'user';</syntaxhighlight>|<syntaxhighlight lang="bash" highlight="2,7,12">
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+
+------+--------+---------+------------+------+----------------+-------------+
| Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length |
| Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length |
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+
+------+--------+---------+------------+------+----------------+-------------+
| user | InnoDB |      10 | Compact    |  12 |          1365 |      16384 |              0 |            0 |
| user | InnoDB |      10 | Compact    |  12 |          1365 |      16384 |
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+
+------+--------+---------+------------+------+----------------+-------------+
+-----------+----------------+---------------------+-------------+------------+-------------------+----------+----------------+---------+
+-----------------+--------------+-----------+----------------+---------------------+
| Data_free | Auto_increment | Create_time         | Update_time | Check_time | Collation        | Checksum | Create_options | Comment |
| Max_data_length | Index_length | Data_free | Auto_increment | Create_time        |
+-----------+----------------+---------------------+-------------+------------+-------------------+----------+----------------+---------+
+-----------------+--------------+-----------+----------------+---------------------+
|         0 |             16 | 2022-01-27 17:12:54 | NULL        | NULL      | latin1_swedish_ci |    NULL |                |        |
|               0 |           0 |        0 |             16 | 2022-01-27 17:12:54 |
+-----------+----------------+---------------------+-------------+------------+-------------------+----------+----------------+---------+
+-----------------+--------------+-----------+----------------+---------------------+
+-------------+------------+-------------------+----------+----------------+---------+
| Update_time | Check_time | Collation        | Checksum | Create_options | Comment |
+-------------+------------+-------------------+----------+----------------+---------+
| NULL        | NULL      | latin1_swedish_ci |    NULL |                |        |
+-------------+------------+-------------------+----------+----------------+---------+
1 row in set (0.01 sec)
1 row in set (0.01 sec)
</syntaxhighlight>|mysql>}}
== information_schema ==
{{Shc_out|<syntaxhighlight lang="mysql">
SELECT *
FROM information_schema.tables
WHERE table_name = 'user';</syntaxhighlight>|<syntaxhighlight lang="bash" highlight="2,9,16,23">
+---------------+--------------+------------+------------+--------+---------+
| TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | TABLE_TYPE | ENGINE | VERSION |
+---------------+--------------+------------+------------+--------+---------+
| def          | mysql        | user      | BASE TABLE | MyISAM |      10 |
| def          | qnpm-local  | user      | BASE TABLE | InnoDB |      10 |
| def          | test        | user      | BASE TABLE | InnoDB |      10 |
+---------------+--------------+------------+------------+--------+---------+
+------------+------------+----------------+-------------+-----------------+--------------+
| ROW_FORMAT | TABLE_ROWS | AVG_ROW_LENGTH | DATA_LENGTH | MAX_DATA_LENGTH | INDEX_LENGTH |
+------------+------------+----------------+-------------+-----------------+--------------+
| Dynamic    |          6 |            88 |        528 | 281474976710655 |        2048 |
| Compact    |          0 |              0 |      16384 |              0 |        32768 |
| Compact    |        12 |          1365 |      16384 |              0 |            0 |
+------------+------------+----------------+-------------+-----------------+--------------+
+-----------+----------------+---------------------+---------------------+------------+
| DATA_FREE | AUTO_INCREMENT | CREATE_TIME        | UPDATE_TIME        | CHECK_TIME |
+-----------+----------------+---------------------+---------------------+------------+
|        0 |          NULL | 2021-08-12 15:48:03 | 2021-08-12 15:59:48 | NULL      |
|  10485760 |              2 | 2021-08-12 16:00:39 | NULL                | NULL      |
|        0 |            16 | 2022-01-27 17:12:54 | NULL                | NULL      |
+-----------+----------------+---------------------+---------------------+------------+
+-------------------+----------+----------------+-----------------------------+
| TABLE_COLLATION  | CHECKSUM | CREATE_OPTIONS | TABLE_COMMENT              |
+-------------------+----------+----------------+-----------------------------+
| utf8_bin          |    NULL |                | Users and global privileges |
| utf8_general_ci  |    NULL |                | user base info              |
| latin1_swedish_ci |    NULL |                |                            |
+-------------------+----------+----------------+-----------------------------+
3 rows in set (0.00 sec)
</syntaxhighlight>|mysql>}}
</syntaxhighlight>|mysql>}}