我试图按照本教程来启用远程访问MySQL。问题是,my.cnf文件应该放在哪里?我使用的是Mac OS X Lion。
当前回答
macOS sierra 10.12.6 MySQL版本:5.7.18_1 我运行locate my。cnf,路径是
/ usr / local / etc / my . cnf
其他回答
将/usr/local/opt/mysql/support-files/my-default.cnf复制为/etc/my.cnf或/etc/mysql/my.cnf,然后重启mysql。
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.
您可以检查文件
/usr/local/bin/mysql.服务器,看看my.conf是从哪里读取的。
通常是从/etc/my.cnf或~/my.cnf或~/.my.cnf
MySQL 5.7 on Mac OS X El Capitan: /usr/local/mysql/etc/my.cnf
从/usr/local/mysql/support-files/my-default.cnf拷贝default conf文件
rDefault选项按照给定的顺序从以下文件中读取: /etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf
推荐文章
- 字符串作为SQL数据库的主键
- Mac SQLite编辑器
- 在MacOS X上推荐用什么方式安装Node.js、nvm和npm ?
- 如何在Swift中删除视图的所有子视图?
- 我如何把一个'if子句'在一个SQL字符串?
- 如何在Mac OS Lion上从命令行启动MySQL服务器?
- 为什么MYSQL的高LIMIT偏移量减慢查询?
- MySQL选择列不为空的位置
- 哪个更快:多个单个INSERT还是一个多行INSERT?
- 搜索mysql数据库中出现的所有字符串
- 如何使用MySQL DECIMAL?
- 比较两个SQL Server数据库(模式和数据)的最佳工具是什么?
- 警告用户/local/mysql/data目录不属于mysql用户
- 如何检查一个表是否存在于给定的模式中
- 添加一个复合主键