如何设置“performance_schema on"在 mysql 中? [英] How to set "performance_schema on" in mysql?
问题描述
我想在 mysql 中打开 performance_schema
以收集统计信息.
I want to turn performance_schema
ON in mysql to collect statistics.
我怎样才能做到这一点?
How can I achieve this?
推荐答案
以下指南是针对 linux 的,但应该很容易适应 Windows.
The following guide is linux-specific, but should easily be adaptable to windows.
您必须检查您使用的 mysql 服务器版本是否支持编译:
You have to check if the mysql server version you use, is compiled with support for it:
mysqld --verbose --help | grep performance-schema
如果你能在那里读到一些东西,你就可以开始了.
If you can read something there, you are good to go.
通过放入/etc/mysql/my.cnf
[mysqld]
performance_schema
之后执行 service mysqld restart
(redhat)(或 debian/ubuntu 上的 service mysql restart
)以重新启动 mysql 服务器.
Afterwards do a service mysqld restart
(redhat) (or service mysql restart
on debian/ubuntu) to restart the mysql server.
关于如何使用性能模式引擎及其输出,请参阅手册:
https://dev.mysql.com/doc/refman/5.5/en/performance-schema-quick-start.html
On how to use the performance schema engine and its output, see the manual:
https://dev.mysql.com/doc/refman/5.5/en/performance-schema-quick-start.html
这篇关于如何设置“performance_schema on"在 mysql 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!