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 ???
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
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.
MysqlTuner正在运行时读取变量和状态。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.