1、查詢整個mysql數據庫,整個庫的大小;單位轉換為MB。

成都創(chuàng)新互聯(lián)公司專業(yè)為企業(yè)提供淮安區(qū)網站建設、淮安區(qū)做網站、淮安區(qū)網站設計、淮安區(qū)網站制作等企業(yè)網站建設、網頁設計與制作、淮安區(qū)企業(yè)網站模板建站服務,10多年淮安區(qū)做網站經驗,不只是建網站,更提供有價值的思路和整體網絡服務。
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data? from information_schema.TABLES
2、查詢mysql數據庫,某個庫的大小;
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data
from information_schema.TABLES
where table_schema = 'testdb'
3、查看庫中某個表的大小;
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data
from information_schema.TABLES
where table_schema = 'testdb'
and table_name = 'test_a';
4、查看mysql庫中,test開頭的表,所有存儲大小;
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data
from information_schema.TABLES
where table_schema = 'testdb'
and table_name like 'test%';
1、進去指定schema 數據庫(存放了其他的數據庫的信息)\x0d\x0ause information_schema\x0d\x0a2、查詢所有數據的大小\x0d\x0aselect concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES\x0d\x0a3、查看指定數據庫的大小\x0d\x0a比如說 數據庫apoyl\x0d\x0aselect concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES where table_schema='apoyl';\x0d\x0a4、查看指定數據庫的表的大小\x0d\x0a比如說 數據庫apoyl 中apoyl_test表\x0d\x0aselect concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES where table_schema='apoyl' and table_name='apoyl_test';\x0d\x0a整完了,有興趣的可以試哈哦!挺使用哈\x0d\x0a網站找的,都是正解
1.查看mysql數據庫大小
SELECT
sum(DATA_LENGTH)+sum(INDEX_LENGTH)
FROM
information_schema.TABLES
where
TABLE_SCHEMA='數據庫名';
得到的結果是以字節(jié)為單位,除1024為K,除1048576(=1024*1024)為M。
2.查看表的最后mysql修改時間
select
TABLE_NAME,UPDATE_TIME
from
INFORMATION_SCHEMA.tables
where
TABLE_SCHEMA='數據庫名';
可以通過查看數據庫中表的mysql修改時間,來確定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';
字符串比較大小不是比較長短
從第一個字符開始比較,相同相等,遇到不同就比較出來了abc,根據ascii碼比較的
abcdabcde
1、進去指定schema
數據庫(存放了其他的數據庫的信息)
use
information_schema
2、查詢所有數據的大小
select
concat(round(sum(DATA_LENGTH/1024/1024),2),'MB')
as
data
from
TABLES
3、查看指定數據庫的大小
比如說
數據庫apoyl
select
concat(round(sum(DATA_LENGTH/1024/1024),2),'MB')
as
data
from
TABLES
where
table_schema='apoyl';
4、查看指定數據庫的表的大小
比如說
數據庫apoyl
中apoyl_test表
select
concat(round(sum(DATA_LENGTH/1024/1024),2),'MB')
as
data
from
TABLES
where
table_schema='apoyl'
and
table_name='apoyl_test';
整完了,有興趣的可以試哈哦!挺使用哈
網頁標題:mysql里怎么看大小 mysql如何查看表的大小
文章地址:http://chinadenli.net/article22/hhjhcc.html
成都網站建設公司_創(chuàng)新互聯(lián),為您提供網站營銷、用戶體驗、定制開發(fā)、網站設計、搜索引擎優(yōu)化、品牌網站制作
聲明:本網站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)