Home  >  Article  >  Database  >  View mysql database size, table size and last modification time

View mysql database size, table size and last modification time

jacklove
jackloveOriginal
2018-06-11 16:29:053363browse

1. View basic information of database tables.

select * from information_schema.TABLES where information_schema.TABLES.TABLE_SCHEMA = '数据库名' and information_schema.TABLES.TABLE_NAME = '表名';

2. Check the mysql database size

SELECT sum(DATA_LENGTH)+sum(INDEX_LENGTH) FROM information_schema.TABLES where TABLE_SCHEMA='数据库名';

The result is in bytes, divided by 1024 is K, divided by 1048576 (=1024*1024) is M.

3. Check the last mysql modification time of the table

select TABLE_NAME,UPDATE_TIME from information_schema.TABLES where TABLE_SCHEMA='数据库名' order by UPDATE_TIME desc limit 1;
select TABLE_NAME,UPDATE_TIME from information_schema.TABLES where TABLE_SCHEMA='数据库名' and information_schema.TABLES.TABLE_NAME = '表名';

This article explains the relevant content of checking the mysql database size, table size and last modification time. For more related knowledge, please pay attention to the php Chinese website.

Related recommendations:

Detailed explanation of Sublime Text 2

How to get CSS property values ​​through JS

How to determine the collision method through JS

How to use CSS to achieve the circle effect (CSS Sprites)

The above is the detailed content of View mysql database size, table size and last modification time. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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