日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

速查mysql数据大小

發布時間:2025/3/17 数据库 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 速查mysql数据大小 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

速查mysql數據大小

# 1、查看所有數據庫大小 mysql> select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data_size from information_schema.TABLES; +-----------+ | data_size | +-----------+ | 2085.96MB | +-----------+ 1 row in set (0.00 sec) # 2、查看指定數據庫大小 mysql> select table_schema,concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data_size from information_schema.TABLES where table_schema in ('db_test','dbtest_59') group by table_schema order by data_size desc; +--------------+-----------+ | table_schema | data_size | +--------------+-----------+ | dbtest_59 | 2060.28MB | | db_test | 0.27MB | +--------------+-----------+ 2 rows in set (0.00 sec) # 3、查看指定單表大小 mysql> select table_schema,table_name,concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data_size from information_schema.TABLES where table_schema='dbtest_59' group by table_name desc order by data_size desc; +--------------+---------------------------------+-----------+ | table_schema | table_name | data_size | +--------------+---------------------------------+-----------+ | dbtest_59 | testbl_auto_schedul_studet_info | 2057.00MB | | dbtest_59 | testb_admin | 2.52MB | | dbtest_59 | testb_rbac_role_user | 0.38MB | | dbtest_59 | testb_rbac_role_access | 0.36MB | | dbtest_59 | testb_rbac_role | 0.02MB | | dbtest_59 | dy_students_info | 0.02MB | +--------------+---------------------------------+-----------+ 6 rows in set (0.00 sec) # 4、查詢數據庫大小

select
table_schema,concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data_size,table_name,table_rows from information_schema.TABLES where table_schema IN('dbtest_59') group by table_name order by table_rows desc; mysql> select table_schema,concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data_size,table_name,table_rows from information_schema.TABLES where table_schema IN('dbtest_59') group by table_name order by table_rows desc; +--------------+-----------+---------------------------------+------------+ | table_schema | data_size | table_name | table_rows | +--------------+-----------+---------------------------------+------------+ | dbtest_59 | 2057.00MB | fudao_auto_schedule_course_info | 1497236 | | dbtest_59 | 2.52MB | fudao_admin | 10406 | | dbtest_59 | 0.38MB | fudao_rbac_role_user | 7778 | | dbtest_59 | 0.36MB | fudao_rbac_role_access | 3534 | | dbtest_59 | 0.02MB | fudao_rbac_role | 70 | | dbtest_59 | 0.02MB | dy_homework_info | 0 | +--------------+-----------+---------------------------------+------------+ 6 rows in set (0.00 sec)

?

轉載于:https://www.cnblogs.com/bjx2020/p/9316829.html

總結

以上是生活随笔為你收集整理的速查mysql数据大小的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。