mysqlshow语法:
mysqlshow [options][db_name [table_name [column_name]]]
使用mysqlshow,无参数
(相当于show databases)
D:\snx_workspace3.7\persistence-part>mysqlshow -hlocalhost -uroot -proot
+--------------------+
| Databases |
+--------------------+
| information_schema |
| job |
| mysql |
| test |
| world |
+--------------------+
使用mysqlshow,用一个参数
(相当于show tables from world)
D:\snx_workspace3.7\persistence-part>mysqlshow -hlocalhost -uroot -proot world
Database: world
+-----------------+
| Tables |
+-----------------+
| allergy |
| auth_info |
| booleans |
| booleans2 |
| city |
| country |
| countrylanguage |
| dup_names |
| t |
| t1 |
| t2 |
| t3 |
| t4 |
| t5 |
| t6 |
| ts_test1 |
| ts_test2 |
| ts_test3 |
| ts_test4 |
| ts_test5 |
| ts_test6 |
| ty |
| unique_names |
+-----------------+
使用mysqlshow,用二个参数
(相当于show full columns from world.t)
D:\snx_workspace3.7\persistence-part>mysqlshow -hlocalhost -uroot -proot world t
Database: world Table: t
+-------+------------------+-----------------+------+-----+------------+-------+---------------------------------+----
| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Com
+-------+------------------+-----------------+------+-----+------------+-------+---------------------------------+----
| i | int(10) unsigned | | NO | | | | select,insert,update,references |
| c | char(10) | utf8_general_ci | YES | | | | select,insert,update,references |
| d | date | | YES | | 1999-12-31 | | select,insert,update,references |
+-------+------------------+-----------------+------+-----+------------+-------+---------------------------------+----
使用mysqlshow,用三个参数
(相当于show full columns from world.t like 'c')
D:\snx_workspace3.7\persistence-part>mysqlshow -hlocalhost -uroot -proot world t c
Database: world Table: t Wildcard: c
+-------+----------+-----------------+------+-----+---------+-------+---------------------------------+---------+
| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
+-------+----------+-----------------+------+-----+---------+-------+---------------------------------+---------+
| c | char(10) | utf8_general_ci | YES | | | | select,insert,update,references | |
+-------+----------+-----------------+------+-----+---------+-------+---------------------------------+---------+
支持模糊查询
D:\snx_workspace3.7\persistence-part>mysqlshow -hlocalhost -uroot -proot world t*
Database: world Wildcard: t%
+----------+
| Tables |
+----------+
| t |
| t1 |
| t2 |
| t3 |
| t4 |
| t5 |
| t6 |
| ts_test1 |
| ts_test2 |
| ts_test3 |
| ts_test4 |
| ts_test5 |
| ts_test6 |
| ty |
+----------+
MySQL中的mysqlshow
最新推荐文章于 2024-08-27 09:43:06 发布