#查看每个数据库所占磁盘大小 SELECT TABLE_SCHEMA AS "库名", , ) AS "表所占空间(MB)", , ) AS "索引所占空间(MB)", ,) AS "空间累计(MB)" FROM information_schema.`TABLES` GROUP BY `TABLE_SCHEMA`; #查看某个数据库各表所占磁盘大小 SELECT TABLE_NAME, , ) AS "DATA_
查询所有数据库占用磁盘空间大小的SQL语句: 语句如下: select TABLE_SCHEMA, concat(truncate(sum(data_length)/1024/1024,2),' MB') as data_size, concat(truncate(sum(index_length)/1024/1024,2),'MB') as index_size from information_schema.tables group by TABLE_SCHEMA order by data
查询所有数据库占用磁盘空间大小的SQL语句: 语句如下 1 2 3 4 5 select TABLE_SCHEMA, concat(truncate(sum(data_length)/1024/1024,2),' MB') as data_size, concat(truncate(sum(index_length)/1024/1024,2),'MB') as index_size from information_schema.tables group by TABLE_SCHEMA orde
查询所有数据库占用磁盘空间大小的SQL语句: 语句如下 select TABLE_SCHEMA, concat(truncate(sum(data_length)/1024/1024,2),' MB') as data_size, concat(truncate(sum(index_length)/1024/1024,2),'MB') as index_size from information_schema.tables group by TABLE_SCHEMA order by data_
.查询所有数据库占用磁盘空间大小 select TABLE_SCHEMA, concat(,),' MB') as data_size, concat(,),'MB') as index_size from information_schema.tables group by TABLE_SCHEMA ORDER BY data_size desc; .查询单个库中所有表磁盘占用大小 select TABLE_NAME, concat(,),' MB') as data_size, concat
${database} 为数据库的名称 /*1.查看索引 (1)单位是GB*/ SELECT CONCAT(ROUND(SUM(index_length)/(**), ), ' GB') AS 'Total Index Size' FROM information_schema.TABLES WHERE table_schema LIKE '${database}'; /* +------------------+ | Total Index Size | +------------------
查询某个表所占用的磁盘空间大小: SELECT CONCAT(ROUND(SUM(data_length/1024/1024),2),'MB') AS data_length_MB, CONCAT(ROUND(SUM(index_length/1024/1024),2),'MB') AS index_length_MB FROM `information_schema`.tables WHERE table_schema='db_name' AND table_name = 'table_nam
查看分区数据量,查看全库数据量 USE information_schema; SELECT PARTITION_NAME,TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 'sale_data'; SELECT table_name,table_rows FROM TABLES WHERE TABLE_SCHEMA = 'db_name' ORDER BY table_rows DESC ; http://my
show slave status 查看从库信息 http://blog.csdn.net/lxpbs8851/article/details/7898716 搭建主从库 http://www.cnblogs.com/lben/archive/2012/11/19/2777632.html http://wenku.baidu.com/link?url=80yn2jpbyxueq1p7Hwkmk-oHDj6LVX8lbfmUcuPn8PEnxA3bzOiwnJyrzyVZ_BNFPF
一.一探究竟 我想看看有多少个数据库,有多少个表,以及表里有啥东西.那么你可以这样: 图形界面: 命令: 查看多少个数据库:注意 后面带s #查看 SHOW DATABASES; #查看表 USE blog; SHOW TABLES; #查看表中的列 SHOW COLUMNS FROM auth_user; DESCRIBE auth_user; describe 表名 是 show columns from 表名 的一种快捷方式. 二.修改mysql数据库密码 方法一: 使用phpmyadmi
1. 查看该数据库实例下所有库大小,得到的结果是以MB为单位 mysql> select table_schema,sum(data_length)/1024/1024 as data_length,sum(index_length)/1024/1024 \ as index_length,sum(data_length+index_length)/1024/1024 as sum from information_schema.tables; +--------------------+---
我们可以在mysql的安装目录下看到mysql的二进制日志文件,如mysql-bin.000***等,很多人都不及时的处理,导致整个硬盘被塞满也是有可能的.这些是数据库的操作日志.它记录了我们平时使用的sql语句命令,即使这个sql语句没有被执行,也会被记录,它包括执行时间之类的都详细在案,其实 它的目的有两个:一是方便我们查错和恢复数据库:二是为了主从服务器之间同步数据用的,主从服务器上所有操作都记录在日志里,从服务器可以根据这些日志来进行相同的操作,确保主从两个同步. 关键词: mysql