mysql - 对于 Homebrew mysql 安装,my.cnf 在哪里?

对于 Homebrew mysql 安装,my.cnf 在哪里?它安装一个吗?

最佳答案

默认没有my.cnf。因此,MySQL 以所有默认设置启动。如果您想创建自己的 my.cnf 来覆盖任何默认值,请将其放在/etc/my.cnf。

另外,您可以运行 mysql --help 并查看列出的 conf 位置。

Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/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.
--defaults-file=#       Only read default options from the given file #.
--defaults-extra-file=# Read this file after the global files are read.

如您所见,还有一些选项可以绕过 conf 文件,或者在命令行调用 mysql 时指定要读取的其他文件。

关于mysql - 对于 Homebrew mysql 安装,my.cnf 在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7973927/

相关文章:

MySQL - 如何按字符串长度选择数据

mysql - UTF-8:一般?垃圾桶?统一码?

mysql - 如何将 CSV 文件导入 MySQL 表?

mysql - MySQL VARCHAR 的最大大小是多少?

mysql - MySQL 中的 utf8mb4 和 utf8 字符集有什么区别?

mysql - 只用 mysqldump 转储数据而没有任何表信息?

mysql - 错误 1396 (HY000) : Operation CREATE USER fa

mysql - 如何更改 max_allowed_pa​​cket 大小

sql - 从一个表中查找另一个表中不存在的记录

mysql - 错误 2006 (HY000) : MySQL server has gone aw