简体   繁体   English

mysql my.cnf为空且mysqltuner

[英]Mysql my.cnf empty and mysqltuner

I'm trying to solve a performance issue I have on a Mysql database and to do that I'm using mysqltuner. 我正在尝试解决Mysql数据库上存在的性能问题,并使用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. 我不明白的是为什么在phpmyadmin和mysqltuner中我提到了几个变量,而当我打开my.cnf文件时却几乎是空的。 There is the maxconnections parameter only. 仅存在maxconnections参数。 Where are stored the other variables ??? 其他变量存储在哪里?

Other variables are defaults. 其他变量是默认值。 My.cnf only override defaults. My.cnf仅覆盖默认值。 You can look for defaults here: https://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html 您可以在此处查找默认值: https : //dev.mysql.com/doc/refman/5.0/en/server-system-variables.html

Most of what mysqltuner comes from mysqltuner大部分来自

SHOW GLOBAL VARIABLES;
SHOW GLOBAL STATUS;

my.cnf is merely the overrides to the default static VARIABLES built into the server. my.cnf仅仅是对服务器内置的默认静态VARIABLES的替代。 STATUS are counters, etc that change over time. STATUS是随时间变化的计数器等。

Note the word GLOBAL . 注意单词GLOBAL Those are the defaults for the corresponding SESSION values that belong to your connection. 这些是属于您的连接的相应SESSION值的默认值。 The VARIABLES you change in phpmyadmin, will not be permanent. 您在phpmyadmin中更改的VARIABLES将不是永久的。 You have to edit my.cnf and restart mysqld to get permanent changes. 您必须编辑my.cnf并重新启动mysqld以获得永久更改。

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正在运行时读取变量和状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM