我试图按照本教程来启用远程访问MySQL。问题是,my.cnf文件应该放在哪里?我使用的是Mac OS X Lion。
当前回答
我不知道你使用的是哪个版本的MySQL,但以下是Mac OS X 5.5版本my.cnf文件的可能位置(从这里取):
/etc/my.cnf /etc/mysql/my.cnf SYSCONFDIR / my.cnf $ MYSQL_HOME / my.cnf Defaults-extra-file(使用——Defaults-extra-file =path指定的文件,如果有的话) ~ / .my.cnf
其他回答
Mac OS X Mavericks的当前MySQL包(在撰写本文时为MySQL -5.6.17-osx10.7-x86_64)在安装期间自动创建my.cnf。
它位于/usr/local/mysql-5.6.17-osx10.7-x86_64/my.cnf 根据您的版本调整路径。
将/usr/local/opt/mysql/support-files/my-default.cnf复制为/etc/my.cnf或/etc/mysql/my.cnf,然后重启mysql。
在Mac OS X Maverick的情况下,当MySQL通过Homebrew安装时,它位于/usr/local/opt/mysql/my.cnf
您可以检查文件
/usr/local/bin/mysql.服务器,看看my.conf是从哪里读取的。
通常是从/etc/my.cnf或~/my.cnf或~/.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.
推荐文章
- 如何关闭mysql密码验证?
- 访问限制:'Application'类型不是API(必需库rt.jar的限制)
- 为什么在Mac OS X v10.9 (Mavericks)的终端中apt-get功能不起作用?
- MySQL区分大小写查询
- 获得PostgreSQL数据库中当前连接数的正确查询
- MySQL数据库表中的最大记录数
- 原则-如何打印出真正的sql,而不仅仅是准备好的语句?
- PHP/MySQL插入一行然后获取id
- 从现有模式生成表关系图(SQL Server)
- “你有邮件”的消息在终端,os X
- HyperLogLog算法是如何工作的?
- 数据库和模式的区别
- 如何从命令行通过mysql运行一个查询?
- Mac OS X中的环境变量
- 如何从命令行在windows中找到mysql数据目录