Linux basic commands --- mysqlshow display database

mysqlshow

mysqlshow is a client program that can display information in a database, table information, field information.

Scope of this command: RedHat, RHEL, Ubuntu, CentOS, Fedora.

 

1 , grammar

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

 

2 , the options parameter list

Options

Explanation

-? | --help

Displays help information

--bind-address=ip

Binding ip

--character-sets-dir

The default character set directory

-i | --status

Additional information display table

-count

The number of rows shown in the table

-C | --compress

Use compression statement between the server and the client

-P | --port

Designated port

--protocol

Designated agreement

-v | --verbose

Show process

-V | --version

Displays version information

-u | --user

Specifies the user

-p | --password

Specify a password

 

3 , examples

1 ) to see which database

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

Enter password: 

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

|     Databases      |

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

| information_schema |

| david              |

| discuz             |

| drupal             |

| mediawiki          |

| mysql              |

| phpmyvisites       |

| test               |

| test01             |

| test02             |

| wordpress          |

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

2 ) Check the database in which tables

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

Enter password: 

Database: test

+--------+

| Tables |

+--------+

| wj     |

+--------+

3 ) What are the fields in Table View

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

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

 

      Made a study of the Linux platform, now came up with a prototype, you can use and reference

      Link: https: //pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ Password: n7bk 

      081634m8n8t2tmz2te95w5.gif


Guess you like

Origin blog.51cto.com/9888479/2422263