View database objects in Mysql (Summary of SQL commands)
View database objects in Mysql (Summary of SQL commands)
The data objects include tables, views, triggers, and so on. (To View statistics, you must enter the information_schema database)
For example, to view table information, follow these steps:
1. Use the information_schema Database
Use information_schema;
2. query the size of all data (MB ):
Select concat (round (sum (data_length/1024/1024), 2), 'mb') as data_size from tables;
3. view the size of the specified database (schema) (MB ):
Select concat (round (sum (data_length/1024/1024), 2), 'mb') as DB_size from tables where table_schema = 'ehr ';
4. view the size of the specified table in the specified database
Select concat (round (sum (data_length/1024/1024), 2), 'mb') as table_size from tables where table_schema = 'ehr' and table_name = 'ehr _ age ';
Actual production environment: the current UI is more powerful than querying statistics one by one, but the SQL statement is at all!