Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set "performance_schema on" in mysql?

I want to turn performance_schema ON in mysql to collect statistics.

How can I achieve this?

like image 407
Vikrant More Avatar asked Nov 15 '25 21:11

Vikrant More


1 Answers

The following guide is linux-specific, but should easily be adaptable to windows.

You have to check wether the mysql server binary was compiled with support for it:

mysqld --verbose --help|grep performance-schema

If the last command returned anything, you are good to go.

Enable it on server startup by putting into /etc/mysql/my.cnf

[mysqld]
performance_schema

Afterwards do a systemctl restart mysqld (redhat) (or systemctl restart mysql on debian/ubuntu) to restart the mysql server.

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

like image 162
sjas Avatar answered Nov 17 '25 11:11

sjas