首页 > 数据库技术 > 详细

Mysql查看数据库对象(SQL命令总结)

时间:2015-03-02 14:56:40      阅读:373      评论:0      收藏:0      [点我收藏+]
Mysql查看数据库对象(SQL命令总结)
数据的对象包括表,视图,触发器,等等(查看统计信息的必须进入information_schema 数据库)

举例查看表相关的信息,步骤如下
1、使用information_schema 数据库
use information_schema; 

2、查询所有数据的大小(MB):
select concat(round(sum(data_length/1024/1024),2),'MB') as data_size from tables; 

3、查看指定数据库(schema)的大小(MB):
select concat(round(sum(data_length/1024/1024),2),'MB') as DB_size from tables where table_schema='ehr';

4、查看指定数据库的指定表(table)的大小

select concat(round(sum(data_length/1024/1024),2),'MB') as table_size from tables where table_schema='ehr' and table_name='ehr_age';

当然了,比逐条SQL查看统计信息更厉害的就是现在的UI界面,有单,实际的东西还是SQL语句

Mysql查看数据库对象(SQL命令总结)

原文:http://blog.csdn.net/jacson_bai/article/details/44017015

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!