查询mysql所有对象_Mysql查看数据库对象(SQL命令总结)
標(biāo)簽:Mysql查看數(shù)據(jù)庫(kù)對(duì)象(SQL命令總結(jié))
數(shù)據(jù)的對(duì)象包括表,視圖,觸發(fā)器,等等(查看統(tǒng)計(jì)信息的必須進(jìn)入information_schema 數(shù)據(jù)庫(kù))
舉例查看表相關(guān)的信息,步驟如下
1、使用information_schema 數(shù)據(jù)庫(kù)
use information_schema;
2、查詢所有數(shù)據(jù)的大小(MB):select concat(round(sum(data_length/1024/1024),2),'MB') as data_size from tables;
3、查看指定數(shù)據(jù)庫(kù)(schema)的大小(MB):
select concat(round(sum(data_length/1024/1024),2),'MB') as DB_size from tables where table_schema='ehr';
4、查看指定數(shù)據(jù)庫(kù)的指定表(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';
當(dāng)然了,比逐條SQL查看統(tǒng)計(jì)信息更厲害的就是現(xiàn)在的UI界面,有單,實(shí)際的東西還是SQL語(yǔ)句
標(biāo)簽:
總結(jié)
以上是生活随笔為你收集整理的查询mysql所有对象_Mysql查看数据库对象(SQL命令总结)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: django安装mysql驱动_djan
- 下一篇: mysql中文时好时坏_mysql索引的