For homebrew mysql installs, where's my.cnf?

前端 未结 13 1355
夕颜
夕颜 2020-12-02 03:16

For homebrew mysql installs, where\'s my.cnf? Does it install one?

13条回答
  •  爱一瞬间的悲伤
    2020-12-02 04:03

    The homebrew mysql contains sample configuration files in the installation's support-files folder.

    ls $(brew --prefix mysql)/support-files/my-*
    

    If you need to change the default settings you can use one of these as a starting point.

    cp $(brew --prefix mysql)/support-files/my-default.cnf /usr/local/etc/my.cnf
    

    As @rednaw points out, a homebrew install of MySQL will most likely be in /usr/local so the my.cnf file should not be added to the system /etc folder, so I’ve changed the command to copy the file into /usr/local/etc.

    If you are using MariaDB rather than MySQL use the following:

    cp $(brew --prefix mariadb)/support-files/my-small.cnf /usr/local/etc/my.cnf
    

提交回复
热议问题