——————————————-分割线————————————————————————————

1

SELECT CONCAT(ROUND(SUM(index_length)/(1024*1024), 2), ‘ MB’) AS
‘Total Index Size’ FROM TABLES  WHERE table_schema = ‘sakila’; 

 

其次步:在指令中输入use information_schema 如图1-2所示:

什么样用命令查看Mysql数据库大小

2、查询全体数据的大小 
     mysql> select concat(round(sum(DATA_LENGTH/1024/1024),2),’MB’)
as data from TABLES;

select concat(round(sum(data_length/1024/1024),2),’MB’) as data from
tables where table_schema=’home’ and table_name=’members’;

 

1、进去钦命schema
数据库(贮存了任何的数据库的新闻) www.2cto.com 1 use
information_schema 2、查询全体数据的大…

1、进去钦命schema 数据库(存放了此外的数据库的音讯)
     mysql> use information_schema;

2、查询全部数据的尺寸:

select concat(round(sum(DATA_LENGTH/1024/1024),2), ‘MB’) as data from
TABLES

 
2、查看钦赐数据库的表的轻重,举个例子说 数据库test中a表 
select concat(round(sum (DATA_LENGTH/1024/1024),2), ‘MB’) as data
from TABLES where table_schema= ‘test’ and table_name= a;

 

5、钦命库的目录大小:

use information_schema;

威澳门尼斯人36366com,1、查询全体数据的尺寸

select concat(round(sum(DATA_LENGTH/1024/1024),2),’MB’) as data  from
TABLES

SELECT CONCAT(ROUND(SUM(index_length)/(1024*1024), 2), ‘ MB’) AS
‘Total Index Size’ FROM TABLES  WHERE table_schema = ‘test’ and
table_name=’sakila’; 

 

 

 

7、二个库中的使用处境:

 

威澳门尼斯人36366com 1

 

SELECT CONCAT(table_schema,’.’,table_name) AS ‘Table Name’,
CONCAT(ROUND(table_rows/1000000,4),’M’) AS ‘Number of Rows’,
CONCAT(ROUND(data_length/(1024*1024*1024),4),’G’) AS ‘Data Size’,
CONCAT(ROUND(index_length/(1024*1024*1024),4),’G’) AS ‘Index Size’,
CONCAT(ROUND((data_length+index_length)/(1024*1024*1024),4),’G’)
AS’Total’FROM information_schema.TABLES WHERE table_schema LIKE
‘sakila’;

比如说查看数据库home的尺寸

Author

发表评论

电子邮件地址不会被公开。 必填项已用*标注