mysqlshow:數(shù)據(jù)庫對象查看工具,用來快速查找存在哪些數(shù)據(jù)庫、數(shù)據(jù)庫中的表、表中的列或索引。
目前創(chuàng)新互聯(lián)公司已為1000+的企業(yè)提供了網(wǎng)站建設(shè)、域名、網(wǎng)站空間、網(wǎng)站托管、服務(wù)器托管、企業(yè)網(wǎng)站設(shè)計(jì)、秦淮網(wǎng)站維護(hù)等服務(wù),公司將堅(jiān)持客戶導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長,共同發(fā)展。選項(xiàng):--count 顯示數(shù)據(jù)庫和表的統(tǒng)計(jì)信息
-k 顯示指定的表中的索引
-i 顯示表的狀態(tài)信息
不帶任何參數(shù)顯示所有數(shù)據(jù)庫
[root@www mysql-5.6.30]# mysqlshow
+--------------------+
| Databases |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
不指定數(shù)據(jù)庫,顯示數(shù)據(jù)庫和表的統(tǒng)計(jì)信息
[root@www mysql-5.6.30]# mysqlshow --count
+--------------------+--------+--------------+
| Databases | Tables | Total Rows |
+--------------------+--------+--------------+
| information_schema | 59 | 13157 |
| mysql | 28 | 2474 |
| performance_schema | 52 | 16615 |
| test | 2 | 24 |
+--------------------+--------+--------------+
4 rows in set.
指定數(shù)據(jù)庫,顯示統(tǒng)計(jì)信息
[root@www mysql-5.6.30]# mysqlshow -uroot test --count
Database: test
+----------+----------+------------+
| Tables | Columns | Total Rows |
+----------+----------+------------+
| backt118 | 4 | 12 |
| t118 | 4 | 12 |
+----------+----------+------------+
2 rows in set.
指定數(shù)據(jù)庫和表,顯示統(tǒng)計(jì)信息
[root@www mysql-5.6.30]# mysqlshow -uroot test t118 --count
Database: test Table: t118 Rows: 12
+---------+----------+-----------------+------+-----+---------+-------+---------------------------------+---------+
| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
+---------+----------+-----------------+------+-----+---------+-------+---------------------------------+---------+
| name | char(10) | utf8_general_ci | YES | MUL | | | select,insert,update,references | |
| age | int(3) | | YES | | | | select,insert,update,references | |
| chushen | date | | YES | | | | select,insert,update,references | |
| shengao | int(3) | | YES | | | | select,insert,update,references | |
+---------+----------+-----------------+------+-----+---------+-------+---------------------------------+---------+
顯示指定表所有的索引,前部分是表的結(jié)構(gòu),后部分是表的索引信息
[root@www mysql-5.6.30]# mysqlshow -uroot test t118 -k
Database: test Table: t118
+---------+----------+-----------------+------+-----+---------+-------+---------------------------------+---------+
| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
+---------+----------+-----------------+------+-----+---------+-------+---------------------------------+---------+
| name | char(10) | utf8_general_ci | YES | MUL | | | select,insert,update,references | |
| age | int(3) | | YES | | | | select,insert,update,references | |
| chushen | date | | YES | | | | select,insert,update,references | |
| shengao | int(3) | | YES | | | | select,insert,update,references | |
+---------+----------+-----------------+------+-----+---------+-------+---------------------------------+---------+
+-------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| t118 | 1 | index_name | 1 | name | A | 12 | | | YES | BTREE | | |
| t118 | 1 | index_ccc | 1 | name | A | 12 | | | YES | BTREE | | |
+-------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
顯示表的狀態(tài)信息
[root@www mysql-5.6.30]# mysqlshow -i -uroot test t118
Database: test Wildcard: t118
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+---------+
| Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment |
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+---------+
| t118 | InnoDB | 10 | Compact | 12 | 1365 | 16384 | 0 | 0 | 0 | | 2017-04-29 22:33:47 | | | utf8_general_ci | | | |
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+---------+
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
網(wǎng)站名稱:MySQL之?dāng)?shù)據(jù)庫對象查看工具mysqlshow-創(chuàng)新互聯(lián)
文章位置:http://www.rwnh.cn/article12/ddcsgc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供搜索引擎優(yōu)化、靜態(tài)網(wǎng)站、品牌網(wǎng)站設(shè)計(jì)、定制網(wǎng)站、網(wǎng)站內(nèi)鏈、虛擬主機(jī)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)