Linux基础命令---mysqlshow显示数据库

mysqlshowphp

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

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

 

1、语法数据库

mysqlshow [options]  [db_name  [tbl_name  [col_name]]] 服务器

 

2、选项参数列表ide

选项wordpress

说明学习

-? | --helpspa

显示帮助信息code

--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 

      081634m8n8t2tmz2te95w5.gif

相关文章
相关标签/搜索