Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
mysql: default to no root password (like 5.6).
Browse files Browse the repository at this point in the history
Point the users to the relevant command so they can secure it more if
they wish.

Closes #46159.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
  • Loading branch information
MikeMcQuaid committed Nov 19, 2015
1 parent 5eba1f9 commit 95e8ec6
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions Library/Formula/mysql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,27 @@ def post_install
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"
Expand Down

0 comments on commit 95e8ec6

Please sign in to comment.