如何用SQL命令查看Mysql数据库大小
要想知道每个数据库的大小的话,步骤如下:
1、进入information_schema 数据库(存放了其他的数据库的信息)
use information_schema;
2、查询所有数据的大小:
select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables;
3、查看指定数据库的大小:
比如查看数据库home的大小
select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='home';
4、查看指定数据库的某个表的大小
比如查看数据库home中 members 表的大小
select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='home' and table_name='members';
相关文章
MySQL 5.6 中TIMESTAMP with implicit DEFAULT value is deprecat
安装mysql的时候出现TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details),可以参考下面的方法解决2015-08-08
Mysql数据库报错2003 Can't connect to MySQL server on
最近在用mysql,打开mysql的图形化界面要连接时出现2003错误,所以下面这篇文章主要给大家介绍了关于Mysql数据库报错2003 Can't connect to MySQL server on 'localhost' (10061)的解决方式,需要的朋友可以参考下2022-09-09


最新评论