Database/MySQL

mysqlshow

catchv 2022. 11. 25. 09:55
반응형

1. mysqlshow

mysqlshow는 서버의 데이터베이스 및 테이블의 정보를 보여줍니다. 

 

$ mysqlshow -uroot -p
+--------------------+
|     Databases      |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| testdb             |
| testdb2            |
+--------------------+

$ mysqlshow -uroot -pRoot12#$ testdb
Database: testdb
+--------+
| Tables |
+--------+
| t1     |
| t2     |
| t3     |
+--------+

$ mysqlshow -uroot -p testdb --status
Database: testdb
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+--------------------+----------+----------------+---------+
| 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 |
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+--------------------+----------+----------------+---------+
| t1   | InnoDB | 10      | Dynamic    | 4    | 4096           | 16384       | 0               | 0            | 0         |                | 2022-11-24 17:00:44 | 2022-11-25 09:21:37 |            | utf8mb4_0900_ai_ci |          |                |         |
| t2   | InnoDB | 10      | Dynamic    | 5    | 3276           | 16384       | 0               | 0            | 0         |                | 2022-11-25 09:50:15 | 2022-11-25 09:50:39 |            | utf8mb4_0900_ai_ci |          |                |         |
| t3   | InnoDB | 10      | Dynamic    | 6    | 2730           | 16384       | 0               | 0            | 0         |                | 2022-11-25 09:50:19 | 2022-11-25 09:50:46 |            | utf8mb4_0900_ai_ci |          |                |         |
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+--------------------+----------+----------------+---------+

$ mysqlshow -uroot -p testdb --count
Database: testdb
+--------+----------+------------+
| Tables | Columns  | Total Rows |
+--------+----------+------------+
| t1     |        1 |          4 |
| t2     |        1 |          5 |
| t3     |        1 |          6 |
+--------+----------+------------+
3 rows in set.

 

반응형

'Database > MySQL' 카테고리의 다른 글

[mysql] errorlog file 사이즈 축소  (0) 2023.03.08
ibd2sdi  (0) 2022.11.25
mysqlslap  (0) 2022.11.25
MySQL Shell (1) - 설치  (0) 2022.11.21
mysqlcheck  (0) 2022.11.18