Home > Database > Mysql Tutorial > 查看mysql各数据库使用大小以及库中每个表最后修改时间_MySQL

查看mysql各数据库使用大小以及库中每个表最后修改时间_MySQL

WBOY
Release: 2016-06-01 13:45:14
Original
1131 people have browsed it

bitsCN.com

这两个语句在平时维护mysql数据库时还是比较常用的
 
1.查看mysql中各database大小
 
 SELECT sum(DATA_LENGTH)+sum(INDEX_LENGTH) FROM information_schema.tables where TABLE_SCHEMA='database_name';
结果是以字节为单位,除1024为K,除1048576为M。
 
 
2.查看表的最后mysql修改时间
 
SELECT TABLE_NAME,UPDATE_TIME FROM information_schema.tables where TABLE_SCHEMA='database_name';
通过查看数据库中表的最后更新时间。(很久没有更新不代表现在没有使用哦)。


作者“永不放弃”

bitsCN.com
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