我试图按照本教程来启用远程访问MySQL。问题是,my.cnf文件应该放在哪里?我使用的是Mac OS X Lion。


当前回答

与所有这些伟大的答案相反。如果你在一个没有sudo权限的环境中工作。你的Homebrew可以安装在你的主目录下~如果是这种情况,你的mysql已经通过brew安装,安装mysql你的my.cnf可以位于~/ Homebrew /etc/my.cnf或者你也可以在你的home目录中查找。/ name 'my.cnf'

其他回答

在Mac OS X Maverick的情况下,当MySQL通过Homebrew安装时,它位于/usr/local/opt/mysql/my.cnf

/private/etc/my.cnf for Catalina

macOS sierra 10.12.6 MySQL版本:5.7.18_1 我运行locate my。cnf,路径是

/ usr / local / etc / my . cnf

In my case, the file did not exist. In MySQL Workbench I went to OPTIONS FILE and found some default values. I clicked apply. It asked for permission. It then created the my.cnf file under /etc. However, it is very important to keep in mind that the first time you click "apply", you do not make any changes to the default configuration. Once the file has been created, you can make changes which will be applied when you click "apply". Otherwise you will not be shown the apply button when you make changes.

您可以打开一个终端并键入locate my.cnf