MySQL 5.7 my.cnf 文件在哪里?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38490785/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 21:56:18  来源:igfitidea点击:

Where is MySQL 5.7 my.cnf file?

mysqlmysql-5.7

提问by Bee

In Ubuntu I had my.cnf file of MySQL 5.6 in /etc/my.cnf. But I can't find the same file of MySQL 5.7. From where can I find that?

在 Ubuntu 中,我有 MySQL 5.6 的 my.cnf 文件在/etc/my.cnf. 但是我找不到与 MySQL 5.7 相同的文件。我从哪里可以找到那个?

I did a find in entire / (root). But I couldn't find it anywhere. Any clues?

我在整个 / (root) 中做了一个查找。但我在任何地方都找不到。有什么线索吗?

I'm trying to set max_connections value.

我正在尝试设置 max_connections 值。

采纳答案by Bee

mysql --help printed below.

mysql --help 打印如下。

Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf 

The following groups are read: mysql client
The following options may be given as the first argument:
--print-defaults        Print the program argument list and exit.
--no-defaults           Don't read default options from any option file,
                        except for login file.
--defaults-file=#       Only read default options from the given file #.
--defaults-extra-file=# Read this file after the global files are read.
--defaults-group-suffix=#
                        Also read groups with concat(group, suffix)
--login-path=#          Read this path from the login file.

回答by neobie

In MySQL 5.7, the default cnf is at:

在 MySQL 5.7 中,默认的 cnf 位于:

/etc/mysql/mysql.conf.d/mysqld.cnf