zoukankan      html  css  js  c++  java
  • mysqlshow(数据库对象查看工具)

    mysqlshow是mysql客户端对象查看工具,可以用来查看数据库、数据库中的表、表中的列、索引等。

    1.mysqlshow命令的语法

    shell > mysqlshow [options] [db_name [tbl_name [column_name]]]
    

    如果不加任何选项,默认就是显示所有数据库。

    # mysqlshow -uroot -p
    Enter password: 
    +--------------------+
    |     Databases      |
    +--------------------+
    | information_schema |
    | data               |
    | mysql              |
    | performance_schema |
    | test               |
    +--------------------+
    

    2.mysqlshow命令的常用选项

    --count:显示数据库和表的统计信息

    如果不指定数据库,则显示每个数据库的表数量、记录数量;如果指定了数据库,则显示数据库的每个表名、字段数量、记录数量;如果指定了某个数据库的某张表,将会显示表的字段信息。

    # mysqlshow -uroot -p --count   --未指定任何数据库
    Enter password: 
    +--------------------+--------+--------------+
    |     Databases      | Tables |  Total Rows  |
    +--------------------+--------+--------------+
    | information_schema |     59 |        13124 |
    | data               |      0 |            0 |
    | mysql              |     28 |         2466 |
    | performance_schema |     52 |        15956 |
    | test               |      1 |            2 |
    +--------------------+--------+--------------+
    # mysqlshow -uroot -p test --count  --指定test数据库
    Enter password: 
    Database: test
    +--------+----------+------------+
    | Tables | Columns  | Total Rows |
    +--------+----------+------------+
    | t1     |        1 |          2 |
    +--------+----------+------------+
    # mysqlshow -uroot -p mysql user --count  --指定mysql数据库的user表
    Enter password: 
    Database: mysql  Table: user  Rows: 6
    ....结果省略.... 

    -k, --keys:显示指定表中的所有索引

    该选项显示两部分内容:一是指定表的表结构,二是指定表的当前索引信息。

    -i, --status:显示指定表的状态信息

     

  • 相关阅读:
    flock对文件锁定读写操作的问题 简单
    hdu 2899 Strange Fuction(二分)
    hdu 2199 Can you solve this equation? (二分)
    poj 3080 Blue Jeans (KMP)
    poj 2823 Sliding Window (单调队列)
    poj 2001 Shortest Prefixes (trie)
    poj 2503 Babelfish (trie)
    poj 1936 All in All
    hdu 3507 Print Article (DP, Monotone Queue)
    fzu 1894 志愿者选拔 (单调队列)
  • 原文地址:https://www.cnblogs.com/sunmengbbm/p/5827634.html
Copyright © 2011-2022 走看看