mysql.rb: Look for my.cnf in both /etc /etc/mysql

Both directories are searched by default.
See http://dev.mysql.com/doc/refman/5.7/en/option-files.html

Closes #8659.

Signed-off-by: Tomasz Pajor <tomek@polishgeeks.com>
This commit is contained in:
Shaun Jackman 2017-01-09 10:07:08 -08:00 committed by Tomasz Pajor
parent 967eac3300
commit dfb64ee434

View file

@ -136,10 +136,10 @@ class Mysql < Formula
To connect run:
mysql -uroot
EOS
if File.exist? "/etc/my.cnf"
if my_cnf = ["/etc/my.cnf", "/etc/mysql/my.cnf"].find { |x| File.exist? x }
s += <<-EOS.undent
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
A "#{my_cnf}" from another install may interfere with a Homebrew-built
server starting up correctly.
EOS
end