查询所有数据库占用磁盘空间大小的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_NAME,DATA_LENGTH+INDEX_LENGTH,TABLE_ROWS FROM information_schema.tables WHERE TABLE_SCHEMA='price_clouds' AND TABLE_NAME='t_match_task_content';
1:show databases; 查看所有的数据库,等同于select schema_name from information_schema.schemata\G.\G 替换;,以纵向报表的形式输出结果,有利于阅读. 2. status 查看mysql数据库的运行状态 3. use 命令选择数据库 例如 use information_schema,当使用此命令后 select schema_name from information_schema.schemata\G,可以为 select
查看索引: select * FROM information_schema.TABLE_CONSTRAINTS ; select * FROM information_schema.TABLE_CONSTRAINTS WHERE TABLE_NAME=‘table_name’ ; 查看表信息: show create table table_name; 查看触发器: SELECT * FROM information_schema.`TRIGGERS`;
查询所有数据库占用磁盘空间大小的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_
修改数据库配置文件:vim /etc/my.cnf [client] user=username password=password 使用shell脚本统计表中的行数据:count.sh #!/bin/bash dbname=test ip=192.168.1.100 for i in `mysql -h$ip -e "show tables from $dbname;" | egrep -v "\||Tables_in_$dbname"` do sleep 1 c
//先进去MySQL自带管理库:information_schema //自己的数据库:rokid_cas_music_test //自己的表:data_song_thirdparty mysql> use information_schema; Database changed mysql> select data_length,index_length from information_schema.tables where table_schema='rokid_cas_music_te
三:判断mysql I/0 性能的一种方式(网络搜集供参考) show global status like 'innodb_dblwr%'\G 如果innodb_dblwr_pages_writen/innodb_dblwr_writes远小于64:1,说明磁盘写入压力不高 show engine innodb status\G 查看缓冲池的方法. select table_name,data_length+index_length,table_rows from