I'm trying to solve a performance issue I have on a Mysql database and to do that I'm using mysqltuner. What I don't understand is why in phpmyadmin and mysqltuner I have several variable mentioned, whereas when I open the my.cnf file is almost empty. There is the maxconnections parameter only. Where are stored the other variables ???
3 Answers
Other variables are defaults. My.cnf only override defaults. You can look for defaults here: https://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html
-
Hi Melanie, sorry but why when I change some variables in phpmyadmin also mysqltuner changes his suggestions and at the same time my.cnf is empty? Where mysqltuner is reading that values ? – Luca Aug 03 '15 at 13:19
Most of what mysqltuner comes from
SHOW GLOBAL VARIABLES;
SHOW GLOBAL STATUS;
my.cnf
is merely the overrides to the default static VARIABLES
built into the server. STATUS
are counters, etc that change over time.
Note the word GLOBAL
. Those are the defaults for the corresponding SESSION
values that belong to your connection. The VARIABLES
you change in phpmyadmin, will not be permanent. You have to edit my.cnf
and restart mysqld to get permanent changes.
Usually you cannot tune your way out of a performance problem. Once you have the main cache size set (which engine are you using? how much ram do you have?), not much other tuning is worth doing.
The main performance gains are from improving the queries and/or the schema, such as adding composite indexes. Let's see a slow query, and we can discuss this further.

- 135,179
- 13
- 127
- 222