Home > Database > Mysql Tutorial > 解析mysql中如何获得数据库的大小

解析mysql中如何获得数据库的大小

WBOY
Release: 2016-06-07 16:16:53
Original
1356 people have browsed it

1.查看mysql数据库大小 SELECT sum(DATA_LENGTH)+sum(INDEX_LENGTH) FROM information_schema.TABLES where TABLE_SCHEMA='数据库名'; 得到的结果是以字节为单位,除1024为K,除1048576(=1024*1024)为M。 2.查看表的最后mysql修改时间 select TABLE_NAME,UPD

1.查看mysql数据库大小
SELECT sum(DATA_LENGTH)+sum(INDEX_LENGTH)
FROM information_schema.TABLES where TABLE_SCHEMA='数据库名';
得到的结果是以字节为单位,除1024为K,,除1048576(=1024*1024)为M。

2.查看表的最后mysql修改时间
select TABLE_NAME,UPDATE_TIME from INFORMATION_SCHEMA.tables where TABLE_SCHEMA='数据库名';
可以通过查看数据库中表的mysql修改时间,来确定mysql数据库是否已经长期不再使用。

 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template