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.