您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

mysql查询数据库的大小

2024/7/24 12:24:47发布41次查看
mysql查询数据库的大小的方法:1、查询整个库的大小,代码为【select concat(round(sum(data_length/1024/1024),2),'mb')】;2、查询某个库的大小,代码为【from informati】。
相关学习推荐:mysql数据库
mysql查询数据库的大小的方法:
1、查询整个mysql数据库,整个库的大小;单位转换为mb。
select concat(round(sum(data_length/1024/1024),2),'mb') as data from information_schema.tables
2、查询mysql数据库,某个库的大小;
select concat(round(sum(data_length/1024/1024),2),'mb') as data from information_schema.tables where table_schema = 'testdb'
3、查看库中某个表的大小;
select concat(round(sum(data_length/1024/1024),2),'mb') as data from information_schema.tables where table_schema = 'testdb' and table_name = 'test_a';
4、查看mysql库中,test开头的表,所有存储大小;
select concat(round(sum(data_length/1024/1024),2),'mb') as data from information_schema.tables where table_schema = 'testdb' and table_name like 'test%';
以上就是mysql查询数据库的大小的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product