Home > Database > Mysql Tutorial > body text

View mysql database size, table size and last modification time

jacklove
Release: 2018-06-11 16:29:05
Original
3333 people have browsed it

1. View basic information of database tables.

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

2. Check the mysql database size

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

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;
Copy after login
select TABLE_NAME,UPDATE_TIME from information_schema.TABLES where TABLE_SCHEMA='数据库名' and information_schema.TABLES.TABLE_NAME = '表名';
Copy after login

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!

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!