背景:
MySQL 5.5开始新增一个数据库:PERFORMANCE_SCHEMA,主要用于收集数据库服务器性能参数。并且库里表的存储引擎均为PERFORMANCE_SCHEMA,而用户是不能创建存储引擎为PERFORMANCE_SCHEMA的表。MySQL5.5默认是关闭的,需要手动开启,在配置文件里添加:
view sourceprint?1.
[mysqld]
2.
performance_schema=ON
查看是否开启:
view sourceprint?1.mysql>show variables like 'performance_schema';2.+--------------------+-------+3.| Variable_name | Value |4.+--------------------+-------+5.| performance_schema | ON |6.+--------------------+-------+
从MySQL5.6开始,默认打开,本文就从MySQL5.6来说明,在数据库使用当中PERFORMANCE_SCHEMA的一些比较常用的功能。具体的信息可以查看官方文档。
相关表信息:
一:配置(setup)表:
view sourceprint?01.zjy@performance_schema 10:16:56>show tables like '%setup%';02.+----------------------------------------+03.| Tables_in_performance_schema (%setup%) |04.+----------------------------------------+05.| setup_actors |06.| s<em style="color:transparent">本文来源[email protected]搞@^&代*@码)网9</em>etup_consumers |07.| setup_instruments |08.| setup_objects |09.| setup_timers |10.+----------------------------------------+
1,setup_actors:配置用户纬度的监控,默认监控所有用户。