brew mysql 添加修改mysql配置
2015-11-03 12:29
585 查看
brew安装的mysql是没有默认配置文件的,因此Mysql使用默认配置启动。我们需要手动创建my.cnf去覆盖默认配置。在/usr/local/opt/mysql 下确实有 my.cnf 但是并没有在启用中,应该是作为一个示例保存在安装目录的吧。所以手动添加配置文件到某个默认目录吧
添加修改mysql配置
你会看到开始的这一行(表示配置文件默认读取顺序)
通常这些位置是没有配置文件的, 所以要自己建一个
按需修改my.cnf
以下是英文资料 摘自http://stackoverflow.com/questions/7973927/for-homebrew-mysql-installs-wheres-my-cnf 最后一段还是比较直白的
添加修改mysql配置
mysqld --help --verbose | more(查看帮助, 按空格下翻)
你会看到开始的这一行(表示配置文件默认读取顺序)
Default options are read from the following files in the given order: /etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf
通常这些位置是没有配置文件的, 所以要自己建一个
ls $(brew --prefix mysql)/support-files/my-*(用这个可以找到样例.cnf)
cp /usr/local/opt/mysql/support-files/my-default.cnf /etc/my.cnf(拷贝到第一个默认读取目录)
按需修改my.cnf
以下是英文资料 摘自http://stackoverflow.com/questions/7973927/for-homebrew-mysql-installs-wheres-my-cnf 最后一段还是比较直白的
There is no my.cnf by default. As such, MySQL starts with all of the default settings. If you want to create your own my.cnf to override any defaults, place it at /etc/my.cnf. Also, you can run mysql --help and look through it for the conf locations listed. 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. As you can see, there are also some options for bypassing the conf files, or specifying other files to read when you invoke mysql on the command line. shareimprove this answer edited Feb 4 '14 at 2:44 answered Nov 2 '11 at 0:14 Jericon 1,614918 15 This no longer seems to be the case; I see a my.cnf file in /usr/local/Cellar/mysql/5.6.15/ (or whichever version you have installed) – William Turrell Dec 30 '13 at 20:02 3 @williamt "mysql --help" doesn't list that file as being used, I think it's just a default that comes with the installation files – Vinicius Pinto Jan 27 '14 at 17:01 1 @williamt I think Vinicius is right. I see /usr/local/Cellar/mysql/5.6.20_1/my.cnf but when I added the log-bin to it and restarted mysqld, it still didn't haven't binary logging enabled. It wasn't until I copied that my.cnf to /etc/my.cnf that binary logging was enabled. Perhaps that my.cnf file is used during the initial install, I'm not sure. – Mark Aug 27 '14 at 20:00 I'm on 5.6.26 and I don't see it there. – Adam Grant Oct 1 at 20:19
相关文章推荐
- mysql show processlist整理
- 查看mysql 主从的状态
- window7 MySql Cluster数据库集群配置
- nodejs+mysql入门实例
- brew安装的mysql启动报错
- mysql 插入中文乱码问题
- Ubuntu下MySQL数据库迁移
- MySQL 1064 错误(付Mysql 关键字-保留字表)
- mysql授权问题:1004 Access denied for user '用户名'@'%' to database
- mysql授权问题:1004 Access denied for user '用户名'@'%' to database
- MySQL主从复制
- MySQL导出数据到txt
- mysql 5.5 master slave搭建
- mysql innobackupex备份恢复
- MySQL主从服务器数据一致性的核对与修复
- mysql常用查询语句
- MySQL 5.7.9 免安装配置
- mysql 远程账户
- MySql优化配置
- MySQL的查询优化