博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mysql查看某张表、库的大小
阅读量:4314 次
发布时间:2019-06-06

本文共 2626 字,大约阅读时间需要 8 分钟。

1、查询某张表的大小

mysql >  select concat(round(sum(DATA_LENGTH/1024/1024),2),'M') from information_schema.tables where table_schema='test' AND table_name='t9';

2、查看某个数据库表的数据

[root@tst-yangsq2-2 ~]# mysqlshow -uroot -p --count testEnter password: Database: test+--------+----------+------------+| Tables | Columns  | Total Rows |+--------+----------+------------+| t1     |        1 |          2 || t2     |        1 |          2 || t3     |        2 |          1 || t4     |        1 |          6 || t5     |        1 |          1 || t6     |        1 |         14 || t7     |        1 |          0 || t8     |        1 |         12 || t9     |        7 |      48147 |+--------+----------+------------+

3、查询某个数据库某张表的数据 #类似于desc

[root@tst-yangsq2-2 ~]# mysqlshow -uroot -p --count test t9Enter password: Database: test  Table: t9  Rows: 48147+--------------+----------------------+-----------+------+-----+-------------------+-----------------------------+---------------------------------+---------+| Field        | Type                 | Collation | Null | Key | Default           | Extra                       | Privileges                      | Comment |+--------------+----------------------+-----------+------+-----+-------------------+-----------------------------+---------------------------------+---------+| payment_id   | smallint(5) unsigned |           | NO   |     |                   |                             | select,insert,update,references |         || customer_id  | smallint(5) unsigned |           | NO   | MUL |                   |                             | select,insert,update,references |         || staff_id     | tinyint(3) unsigned  |           | NO   | MUL |                   |                             | select,insert,update,references |         || rental_id    | int(11)              |           | YES  | MUL |                   |                             | select,insert,update,references |         || amount       | decimal(5,2)         |           | NO   |     |                   |                             | select,insert,update,references |         || payment_date | datetime             |           | NO   |     |                   |                             | select,insert,update,references |         || last_update  | timestamp            |           | YES  |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP | select,insert,update,references |         |+--------------+----------------------+-----------+------+-----+-------------------+-----------------------------+---------------------------------+---------+
 

 

 

 

转载于:https://www.cnblogs.com/Knight7971/p/9963299.html

你可能感兴趣的文章
angularjs基础——控制器
查看>>
前端设计师如何提高UI界面中的阅读性
查看>>
APP版本号记录
查看>>
母函数
查看>>
最长不重复子串
查看>>
POJ 3621
查看>>
PHP ajax实现数组返回
查看>>
java web 自定义filter
查看>>
J.U.C Atomic(二)基本类型原子操作
查看>>
POJ---2945 Find the Clones[字典树-简单题(多例输入注意删除)]
查看>>
[Luogu4550] 收集邮票
查看>>
Python-循环
查看>>
(转)最大子序列和问题 看着貌似不错
查看>>
thinkphp3.2 链接数据库测试
查看>>
项目的上线流程是怎样的?
查看>>
Linux通配符
查看>>
ES6 Iterator
查看>>
Apache2.4开启GZIP功能
查看>>
远程桌面关闭重启电脑的方法
查看>>
第三章 熟悉常用的HDFS操作
查看>>