zoukankan      html  css  js  c++  java
  • Linux基础命令---mysqlshow显示数据库

    mysqlshow

          mysqlshow是一个客户端的程序,它可以显示数据库的信息、表信息、字段信息。

          此命令的适用范围:RedHat、RHEL、Ubuntu、CentOS、Fedora。

     

    1、语法

          mysqlshow [options]  [db_name  [tbl_name  [col_name]]] 

     

    2、选项参数列表

    选项

    说明

    -? | --help

    显示帮助信息

    --bind-address=ip

    绑定ip

    --character-sets-dir

    默认的字符集目录

    -i | --status

    显示表格的额外信息

    -count

    显示表中的行数

    -C | --compress

    在服务器和客户端之间使用压缩语句

    -P | --port

    指定端口

    --protocol

    指定协议

    -v | --verbose

    显示详细过程

    -V | --version

    显示版本信息

    -u | --user

    指定用户

    -p | --password

    指定密码

     

    3、实例

    1)查看有哪些数据库

    [root@localhost ~]# mysqlshow -u root –p              //显示有哪些数据库

    Enter password: 

    +--------------------+

    |     Databases      |

    +--------------------+

    | information_schema |

    | david              |

    | discuz             |

    | drupal             |

    | mediawiki          |

    | mysql              |

    | phpmyvisites       |

    | test               |

    | test01             |

    | test02             |

    | wordpress          |

    +--------------------+

    2)查看数据库中有哪些表

    [root@localhost ~]# mysqlshow -u root -p test               //显示数据库test的信息

    Enter password: 

    Database: test

    +--------+

    | Tables |

    +--------+

    | wj     |

    +--------+

    3)查看表中有哪些字段

    [root@localhost ~]# mysqlshow -u root -p test wj              //显示数据库test中的表wj的信息

    Enter password: 

    Database: test  Table: wj

    +-------+---------+-------------------+------+-----+---------+-------+---------------------------------+---------+

    | Field | Type    | Collation         | Null | Key | Default | Extra | Privileges                      | Comment |

    +-------+---------+-------------------+------+-----+---------+-------+---------------------------------+---------+

    | id    | int(11) |                   | NO   |     |         |       | select,insert,update,references |         |

    | name  | text    | latin1_swedish_ci | NO   |    |         |       | select,insert,update,references |         |

    +-------+---------+-------------------+------+-----+---------+-------+---------------------------------+---------+

         

          做了一个Linux学习的平台,目前出来一个雏形,各位可以参考使用
          链接:https://pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ 密码:n7bk

         

  • 相关阅读:
    Hibernate整合Druid数据库连接池遇到的问题整合
    Spring 整合quartz 时 定时任务被调用两次以及quartz 的配置
    BigDecimal divide:Non-terminating decimal expansion; no exact representable decimal result.
    Hibernate: Encountered a duplicated sql alias [] during auto-discovery of a native-sql
    oracle与mysql的区别
    搜索评价指标——NDCG
    java 动态修改注解值
    eclipse 取消置顶
    Xiangqi
    All in All
  • 原文地址:https://www.cnblogs.com/wj78080458/p/10849206.html
Copyright © 2011-2022 走看看