[b]mysqlshow[/b]

  mysqlshow是一个客户端的程序,它可以显示数据库的信息、表信息、字段信息。  此命令的适用范围:RedHat、RHEL、Ubuntu、CentOS、Fedora。

[b]1、语法[/b]

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

[b]2、选项参数列表[/b]

  -? | --help        显示帮助信息  --bind-address=ip        绑定ip  --character-sets-dir        默认的字符集目录  -i | --status        显示表格的额外信息  -count        显示表中的行数  -C | --compress        在服务器和客户端之间使用压缩语句  -P | --port        指定端口  --protocol        指定协议  -v | --verbose        显示详细过程  -V | --version        显示版本信息  -u | --user        指定用户  -p | --password        指定密码

[b]3、实例[/b]
1)查看有哪些数据库

  [root@localhost ~]# [b]mysqlshow -u root –p              //显示有哪些数据库[/b]  Enter password:   +--------------------+  |     Data s      |  +--------------------+  | information_schema |  | david              |  | discuz             |  | drupal             |  | mediawiki          |  | mysql              |  | phpmyvisites       |  | test               |  | test01             |  | test02             |  | wordpress          |  +--------------------+ 

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

  [root@localhost ~]# [b]mysqlshow -u root -p test               //显示数据库test的信息[/b]  Enter password:   Data : test  +--------+  | Tables |  +--------+  | wj     |  +--------+ 

3)查看表中有哪些字段

  [root@localhost ~]#[b] mysqlshow -u root -p test wj              //显示数据库test中的表wj的信息[/b]  Enter password:   Data : 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 

img=https://img-bbs.csdn.net/upload/201905/11/1557539226_827504.gif

收藏 打印