首页 数据库 mysql教程 MySQLStudy之--MySQL工具mysqlshow_MySQL

MySQLStudy之--MySQL工具mysqlshow_MySQL

Jun 01, 2016 pm 12:59 PM
工具

 

MySQL Study之--MySQL工具mysqlshow

mmysqlshow客户可用来很快地查找存在哪些数据库,数据库中的表,表中的列或索

mysqlshow为一些SQL显示语句提供了一个命令行界面。相同的信息可以通过直接使用那些语句获得。例如,你可以从mysql客户程序发出它们。

象这样调用mysqlshow:
shell> mysqlshow[选项] [db_name [tbl_name [col_name]]
  • 如果没有给出数据库,显示所有匹配的数据库。
  • 如果没有给出表,显示数据库中所有匹配的表。
  • 如果没有给出列,显示表中所有匹配的列和列类型。

 

案例:

 

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

[root@mysrv mysql]# mysqlshow --help

mysqlshow  Ver 9.10 Distrib 5.1.66, for redhat-linux-gnu (x86_64)

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

 

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

 

Shows the structure of a MySQL database (databases, tables, and columns).

 

Usage: mysqlshow [OPTIONS] [database [table [column]]]

 

If last argument contains a shell or SQL wildcard (*,?,% or _) then only

what's matched by the wildcard is shown.

If no database is given then all matching databases are shown.

If no table is given, then all matching tables in database are shown.

If no column is given, then all matching columns and column types in table

are shown.

 

Default options are read from the following files in the given order:

/etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf

The following groups are read: mysqlshow client

The following options may be given as the first argument:

--print-defaults        Print the program argument list and exit.

--no-defaults           Don't read default options from any option file.

--defaults-file=#       Only read default options from the given file #.

--defaults-extra-file=# Read this file after the global files are read.

  -c, --character-sets-dir=name

                      Directory for character set files.

  --default-character-set=name

                      Set the default character set.

  --count             Show number of rows per table (may be slow for non-MyISAM

                      tables).

  -C, --compress      Use compression in server/client protocol.

  -#, --debug[=name]  Output debug log. Often this is 'd:t:o,filename'.

  --debug-check       Check memory and open file usage at exit.

  --debug-info        Print some debug info at exit.

  -?, --help          Display this help and exit.

  -h, --host=name     Connect to host.

  -i, --status        Shows a lot of extra information about each table.

  -k, --keys          Show keys for table.

  -p, --password[=name]

                      Password to use when connecting to server. If password is

                      not given, it's solicited on the tty.

  -P, --port=#        Port number to use for connection or 0 for default to, in

                      order of preference, my.cnf, $MYSQL_TCP_PORT,

                      /etc/services, built-in default (3306).

  --protocol=name     The protocol to use for connection (tcp, socket, pipe,

                      memory).

  -t, --show-table-type

                      Show table type column.

  -S, --socket=name   The socket file to use for connection.

  --ssl               Enable SSL for connection (automatically enabled with

                      other flags).Disable with --skip-ssl.

  --ssl-ca=name       CA file in PEM format (check OpenSSL docs, implies

                      --ssl).

  --ssl-capath=name   CA directory (check OpenSSL docs, implies --ssl).

  --ssl-cert=name     X509 cert in PEM format (implies --ssl).

  --ssl-cipher=name   SSL cipher to use (implies --ssl).

  --ssl-key=name      X509 key in PEM format (implies --ssl).

  --ssl-verify-server-cert

                      Verify server's "Common Name" in its cert against

                      hostname used when connecting. This option is disabled by

                      default.

  -u, --user=name     User for login if not current user.

  -v, --verbose       More verbose output; you can use this multiple times to

                      get even more verbose output.

  -V, --version       Output version information and exit.

 

Variables (--variable-name=value)

and boolean options {FALSE|TRUE}  Value (after reading options)

--------------------------------- -----------------------------

character-sets-dir                (No default value)

default-character-set             latin1

count                             FALSE

compress                          FALSE

debug-check                       FALSE

debug-info                        FALSE

host                              (No default value)

status                            FALSE

keys                              FALSE

port                              3306

show-table-type                   FALSE

socket                            /tmp/mysql.sock

ssl                               FALSE

ssl-ca                            (No default value)

ssl-capath                        (No default value)

ssl-cert                          (No default value)

ssl-cipher                        (No default value)

ssl-key                           (No default value)

ssl-verify-server-cert            FALSE

user                              (No default value)<strong>

</strong>

登录后复制

 

1、不指定查看的database

[root@mysrv mysql]# mysqlshow -uroot -poracle
+--------------------+
| Databases |
+--------------------+
| information_schema |
| mysql |
| mysqlslap |
| performance_schema |
| prod |
| sakila |
| test |
+--------------------+
2、指定查看的database

[root@mysrv mysql]# mysqlshow -uroot -poracle mysql
Database: mysql
+---------------------------+
| Tables |
+---------------------------+
| columns_priv |
| db |
| event |
| func |
| general_log |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
| host |
| innodb_index_stats |
| innodb_table_stats |
| ndb_binlog_index |
| plugin |
| proc |
| procs_priv |
| proxies_priv |
| servers |
| slave_master_info |
| slave_relay_log_info |
| slave_worker_info |
| slow_log |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| user |
+---------------------------+
[root@mysrv mysql]# mysqlshow -uroot -poracle prod
Database: prod
+--------+
| Tables |
+--------+
| t1 |
| t2 |
| t3 |
| t4 |
+--------+

3、查看指定

[root@mysrv mysql]# mysqlshow -uroot -poracle prod t1
Database: prod Table: t1
+-------+-------------+-------------------+------+-----+---------+-------+---------------------------------+---------+
| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
+-------+-------------+-------------------+------+-----+---------+-------+---------------------------------+---------+
| id | int(11) | | NO | PRI | 0 | | select,insert,update,references | |
| name | varchar(10) | latin1_swedish_ci | YES | | | | select,insert,update,references | |
+-------+-------------+-------------------+------+-----+---------+-------+---------------------------------+---------+
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

Video Face Swap

Video Face Swap

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

十大数字货币交易所app推荐 币圈虚拟币交易所排名前十 十大数字货币交易所app推荐 币圈虚拟币交易所排名前十 Apr 22, 2025 pm 03:03 PM

十大数字货币交易所app推荐:1. OKX,2. Binance,3. gate.io,4. Huobi,5. Coinbase,6. KuCoin,7. Kraken,8. Bitfinex,9. Bybit,10. Bitstamp,这些app均提供实时行情、技术分析和价格提醒功能,帮助用户实时监控市场动态并做出明智的投资决策。

靠谱好用的虚拟币交易所app推荐 币圈十大交易所排行榜最新 靠谱好用的虚拟币交易所app推荐 币圈十大交易所排行榜最新 Apr 22, 2025 pm 01:21 PM

靠谱好用的虚拟币交易所app是:1. Binance,2. OKX,3. Gate.io,4. Coinbase,5. Kraken,6. Huobi Global,7. Bitfinex,8. KuCoin,9. Bittrex,10. Poloniex。这些平台因其交易量、用户体验和安全性等因素被评选为最佳,均提供注册、验证、存款、提款和交易操作功能。

十大数字虚拟货币app排行榜 币圈交易数字货币交易所排名前十 十大数字虚拟货币app排行榜 币圈交易数字货币交易所排名前十 Apr 22, 2025 pm 03:00 PM

十大数字虚拟货币app排行榜分别是:1. OKX,2. Binance,3. gate.io,4. Coinbase,5. Kraken,6. Huobi,7. KuCoin,8. Bitfinex,9. Bitstamp,10. Poloniex。这些交易所根据交易量、用户体验和安全性等因素评选,均提供多种数字货币交易服务和高效的交易体验。

2025数字货币交易平台有哪些 十大数字货币app最新排行榜 2025数字货币交易平台有哪些 十大数字货币app最新排行榜 Apr 22, 2025 pm 03:09 PM

十大虚拟币看盘平台app推荐:1. OKX,2. Binance,3. Gate.io,4. Huobi,5. Coinbase,6. Kraken,7. Bitfinex,8. KuCoin,9. Bybit,10. Bitstamp,这些平台提供实时行情、技术分析工具和用户友好的界面,帮助投资者进行有效的市场分析和交易决策。

meme币交易所排行榜 meme币主流交易所top10盘点 meme币交易所排行榜 meme币主流交易所top10盘点 Apr 22, 2025 am 09:57 AM

最适合交易Meme币的平台包括:1. 币安(Binance),全球最大,流动性高,低手续费;2. 欧意(OKX),高效交易引擎,支持多种Meme币;3. XBIT,去中心化,支持跨链交易;4. 雷迪姆(Solana DEX),低成本,结合Serum订单簿;5. PancakeSwap(BSC DEX),交易费用低,速度快;6. Orca(Solana DEX),用户体验优化;7. Coinbase,安全性高,适合新手;8. 火币(Huobi),亚洲知名,交易对丰富;9. DEXRabbit,智能

免费的看盘软件网站有哪些 币圈十大免费看行情软件排名 免费的看盘软件网站有哪些 币圈十大免费看行情软件排名 Apr 22, 2025 am 10:57 AM

币圈十大免费看行情软件排名前三分别是OKX、Binance和gate.io。 1. OKX提供简洁界面和实时数据,支持多种图表和市场分析。 2. Binance功能强大,数据准确,适合各种交易者。 3. gate.io以稳定性和全面性着称,适合长期和短线投资者。

适合新手的数字货币交易App有哪些?一文了解币圈 适合新手的数字货币交易App有哪些?一文了解币圈 Apr 22, 2025 am 08:45 AM

选择适合新手的数字货币交易平台需考虑安全性、易用性、教育资源和费用透明度:1. 优先选择提供冷存储、双重验证和资产保险的平台;2. 界面简洁、操作清晰的App更适合新手;3. 平台应提供教程和市场分析等学习工具;4. 注意交易手续费和提现费等隐性成本。

币圈行情实时数据免费平台推荐前十名发布 币圈行情实时数据免费平台推荐前十名发布 Apr 22, 2025 am 08:12 AM

适合新手的加密货币数据平台有CoinMarketCap和非小号。1. CoinMarketCap提供全球加密货币实时价格、市值、交易量排名,适合新手与基础分析需求。2. 非小号提供中文友好界面,适合中文用户快速筛选低风险潜力项目。

See all articles