View mysql database size

Source: Internet
Author: User
1. Enter the information_schema database (information of other databases is stored) useinformation_schema; 2. query the size of all data: selectconcat (round (sum (data_length10241024), 2), 'mb ') asdatafromtables; 3. view the size of a specified database, such as the size of the Database home.

1. Enter the information_schema database (information of other databases is stored) use information_schema; 2. query the size of all data: select concat (round (sum (data_length/1024/1024), 2 ), 'mb ') as data from tables; 3. view the size of the specified database, for example, view the size of the Database home.

1. Enter the information_schema database (storing information about other databases)

Use information_schema;

2. query the size of all data:

Select concat (round (sum (data_length/1024/1024), 2), 'mb') as data from tables;

3. view the size of the specified database:

For example, you can view the size of the Database home.

Select concat (round (sum (data_length/1024/1024), 2), 'mb') as data from tables where table_schema = 'home ';

4. view the size of a table in the specified database

For example, you can view the size of the members table in the Database home.

Select concat (round (sum (data_length/1024/1024), 2), 'mb') as data from tables where table_schema = 'Home' and table_name = 'members ';

?

Link: http://blog.csdn.net/atec2000/article/details/7041352

Original article address: view the mysql database size. Thank you for sharing it with the original author.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.