mysql: default to no root password (like 5.6).

Point the users to the relevant command so they can secure it more if
they wish.

Closes Homebrew/homebrew#46159.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Mike McQuaid 2015-11-19 10:06:35 +00:00
parent aba2bab20a
commit 4a90e1087b

View file

@ -134,18 +134,27 @@ class Mysql < Formula
datadir.mkpath
unless (datadir/"mysql/user.frm").exist?
ENV["TMPDIR"] = nil
system bin/"mysqld", "--initialize", "--user=#{ENV["USER"]}",
system bin/"mysqld", "--initialize-insecure", "--user=#{ENV["USER"]}",
"--basedir=#{prefix}", "--datadir=#{datadir}", "--tmpdir=/tmp"
end
end
def caveats; <<-EOS.undent
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.
def caveats
s = <<-EOS.undent
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
To connect:
To connect run:
mysql -uroot
EOS
if File.exist? "/etc/my.cnf"
s += <<-EOS.undent
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.
EOS
end
s
end
plist_options :manual => "mysql.server start"