当前位置:Gxlcms > 数据库问题 > mysql查询数据库大小

mysql查询数据库大小

时间:2021-07-01 10:21:17 帮助过:4人阅读

查看数据库大小的方法:
MariaDB [mysql]> show databases;
MariaDB [mysql]> use information_schema;
查询所有数据库大小:
MariaDB [mysql]> select concat(round(sum(DATA_LENGTH/1024/1024),2),‘MB‘) as data from TABLES;
查询制定的数据库大小:
MariaDB [mysql]> select concat(round(sum(DATA_LENGTH/1024/1024),2),‘MB‘) as data from TABLES where table_schema=‘VIEWS‘;
可以看到,查询数据库大小只需要制定数据库的名称即可,如果需要查询数据库内制定表的大小,在最后添加条件即可:
MariaDB [mysql]> select concat(round(sum(DATA_LENGTH/1024/1024),2),‘MB‘) as data from TABLES where table_schema=‘VIEWS‘ and table_name=‘name‘;

mysql查询数据库大小

标签:ble   base   inf   schema   adb   sch   use   length   方法   

人气教程排行