MySQL/SHOW
来自康健生活
< MySQL
标题文字
数据库
mysql>
SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| nocodb |
| performance_schema |
| qnpm-local |
| test |
+--------------------+
6 rows in set (0.01 sec)
表结构
mysql>
SHOW CREATE TABLE user;
+-------+-----------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-----------------------------------------------------------------------------------------------------+
| user | CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1 |
+-------+-----------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
表状态
mysql>
SHOW TABLE STATUS WHERE Name = 'user';
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+
| Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length |
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+
| user | InnoDB | 10 | Compact | 12 | 1365 | 16384 | 0 | 0 |
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+
+-----------+----------------+---------------------+-------------+------------+-------------------+----------+----------------+---------+
| Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment |
+-----------+----------------+---------------------+-------------+------------+-------------------+----------+----------------+---------+
| 0 | 16 | 2022-01-27 17:12:54 | NULL | NULL | latin1_swedish_ci | NULL | | |
+-----------+----------------+---------------------+-------------+------------+-------------------+----------+----------------+---------+
1 row in set (0.01 sec)
No categories