navicat查mysql数据库大小_navicat查看MySQL数据库、表容量大小

1. 查看所有数据库容量大小

select

table_schema as '数据库',

sum(table_rows) as '记录数',

sum(truncate(data_length/1024/1024, 2)) as '数据容量(MB)',

sum(truncate(index_length/1024/1024, 2)) as '索引容量(MB)'

from information_schema.tables

group by table_schema

order by sum(data_length) desc, sum(index_length) desc;

 

注意:点击运行,如果出现错误:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '数据库' at line 1

解决办法:多次点击运行就行

2. 查看所有数据库各表容量大小

select

table_schema as '数据库',

table_name as '表名',

table_rows as '记录数',

truncate(data_length/1024/1024, 2) as '数据容量(MB)',

truncate(index_length/1024/1024, 2) as '索引容量(MB)'

from information_schema.tables

order by data_length desc, index_length desc;

3. 查看指定数据库容量大小

例:查看mysql库容量大小

select

table_schema as '数据库',

sum(table_rows) as '记录数',

sum(truncate(data_length/1024/1024, 2)) as '数据容量(MB)',

sum(truncate(index_length/1024/1024, 2)) as '索引容量(MB)'

from information_schema.tables

where table_schema='mysql';

4. 查看指定数据库各表容量大小

例:查看mysql库各表容量大小

select

table_schema as '数据库',

table_name as '表名',

table_rows as '记录数',

truncate(data_length/1024/1024, 2) as '数据容量(MB)',

truncate(index_length/1024/1024, 2) as '索引容量(MB)'

from information_schema.tables

where table_schema='mysql'

order by data_length desc, index_length desc;
 

  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Navicat for MySQL是一款流行的MySQL图形化管理工具,它为技术人员提供了一套功能齐全的专用工具,同时针对入门者而言又便于上手。它是基于Windows系统的,为MySQL量身定制,提供类似MySQL Workbench的界面化管理工具。Navicat for MySQL具备广泛的功能,配置了一套简易、便于应用的用户界面来管理和处理数据。它还具备数据同步的功能,可以解析和备份数据库之间的数据,以保证每一个数据库储存同样的信息。选择Navicat for MySQL可以大大减少开发成本,提高开发效率,同时提供了图形界面管理用户和访问权限的管理工具,方便数据迁移和备份,提高容灾恢复能力。 #### 引用[.reference_title] - *1* [(硬 核)Navicat for MySQL 介 绍( 入 门 须 知 )](https://blog.csdn.net/m0_58816922/article/details/117466052)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* *3* [Navicat for MySQLMySQL是什么关系?Navicat for MySQL的详细介绍](https://blog.csdn.net/nayun123/article/details/117926783)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值