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

     


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM