如何登錄mysql數據庫,mysql 日志大小_查看mysql日志文件大小和數據庫大小

 2023-11-14 阅读 24 评论 0

摘要:查看數據庫日志文件的大小show binary logs;刪除bin-log(刪除mysql-bin.00000*小于mysql-bin.000003所有日志)如何登錄mysql數據庫。purge binary logs to 'mysql-bin.000003';要想知道每個數據庫的大小的話,步驟如下:1、進入information_schema 數據庫

查看數據庫日志文件的大小

show binary logs;

刪除bin-log(刪除mysql-bin.00000*小于mysql-bin.000003所有日志)

如何登錄mysql數據庫。purge binary logs to 'mysql-bin.000003';

要想知道每個數據庫的大小的話,步驟如下:

1、進入information_schema 數據庫(存放了其他的數據庫的信息)

use information_schema;

mysql 日志文件,2、查詢所有數據的大小:

select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables;

SELECT SUM(DATA_LENGTH)+SUM(INDEX_LENGTH) FROM information_schema.tables

3、查看指定數據庫的大小:

mysql數據庫界面。比如查看數據庫radius的大小

select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='radius';

4、查看指定數據庫的某個表的大小

比如查看數據庫radius中 rm_users 表的大小

MySQL修改字段長度,select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='radius' and table_name='rm_users';

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/5/172987.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息