Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to check the size of mysql database, table size and last modification time

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Today, the editor to share with you is to view the mysql database size, table size and the last modification time of the method, many people do not understand, today the editor in order to let you know more about the mysql database, so give you a summary of the following content, let's look down. I'm sure you'll get something.

1. View basic information about database tables.

Select * from information_schema.TABLES where information_schema.TABLES.TABLE_SCHEMA = 'database name' and information_schema.TABLES.TABLE_NAME = 'table name'

two。 View mysql database size

SELECT sum (DATA_LENGTH) + sum (INDEX_LENGTH) FROM information_schema.TABLES where TABLE_SCHEMA=' database name'

The result is in bytes, except 1024 for K and 1048576 (= 1024 to 1024) for M.

3. View the last mysql modification time of the table

Select TABLE_NAME,UPDATE_TIME from information_schema.TABLES where TABLE_SCHEMA=' database name 'order by UPDATE_TIME desc limit 1 * select TABLE_NAME,UPDATE_TIME from information_schema.TABLES where TABLE_SCHEMA=' database name' and information_schema.TABLES.TABLE_NAME = 'table name'

The method of viewing mysql database size, table size and last modification time is shared here, of course, not only the above and everyone's analysis methods, but the editor can ensure its accuracy is absolutely no problem. I hope that the above content can have a certain reference value for everyone, and can be put into practice. If you like this article, you might as well share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report