1、下载安装 percona-toolkit 工具包http://www.percona.com/downloads/percona-toolkit/LATEST/tarball/
2、运行下面两个工具,结果拷屏
pt-summary
pt-mysql-summary --socket=path_to_mysql_socket_dir/mysql.sock
---mysql> select count(*) as cnt,table_schema,engine from information_schema.tables where table_schema not in('mysql','information_schema','PERFORMANCE_SCHEMA') group by table_schema,engine order by cnt desc;
3、查看MySQL中,都使用了哪些引擎
mysql> select table_schema,table_name,engine,TABLE_ROWS,AVG_ROW_LENGTH,DATA_LENGTH,INDEX_LENGTH from information_schema.tables where table_schema not in('mysql','information_schema','PERFORMANCE_SCHEMA') order by table_schema,TABLE_ROWS desc;
如果mysql版本较低,可在业务数据库下执行show table status;
4、业务高峰期时,在操作系统上执行vmstat -S m 3 100(或者vmstat 3 100)的结果
5、查看线程状态
mysql> show processlist;
6、如果第5步有不少SQL经常能看到,把那些SQL的执行计划也收集下,以及相应表的DDL
mysql> explain select....
mysql> show create table table_name;
mysql> show index from table_name;
7、提供慢日志统计结果
mysqldumpslow slow.log > slow-stat.log
slow.log文件名改成你真正的慢日志文件名
相关文章
- mysql数据库字段类型的选择原则
- Flask与mysql数据库字段类型的区别以及基本用法
- MySQL_西安11月销售昨日未上架的产品_20161212
- mysql水仙花数,水仙花数_水仙花数c语言程序
- mysql配置白名单
- centos 下搭建 php环境(2) mysql 安装
- mysql 开发进阶篇系列 24 查询缓存下
- 09_MySQL DQL_SQL99标准中的多表查询(外连接)
- MySQL Error: PROCEDURE xmdk.query_all_plan can't return a result set in the given context
- configure: error: mysql configure failed. Please check config.log for more information.