1

I installed MySQL:

installed

but MySQL certainly isn't on the path when I open a terminal, nor do I see it in applications, as I seem to recall Windows handles MySQL.

2 Answers 2

1

The mysql installer works just fine, I've used it many times.

However, it will never appear in Applications as it is not a GUI application.

And it won't appear in your terminal path unless you put it there. Mysql lives in /usr/local/mysql/bin/mysql. If you also install the Mysql preference pane you can start and stop mysqld via System Preferences.

There is absolutely no need to drag in an entire package manager (homebrew / macports / fink) for something that has an installer. That's like calling a moving company to put your dishes away.

Also consider that package managers typically require XCode as well - that's an additional 6+ Gb to install. Oracle's installer is 172Mb.

7
  • There is no need, but it is just more practical to install software using Homebrew, given that it is highly scriptable, it harmonizes the installation processes of different software packages and its formulas are regularly updated. It also often offers more options than a regular installer (bindings, compile options, etc...). I agree that Mysql's binary distribution is totally fine, but there is nothing wrong with installing it through Homebrew if we don't need all the bells and whistles coming with Oracle's installer package. Commented Mar 20, 2015 at 14:13
  • Oracle's .pkg has no bells + whistles. And now that you are dependent on homebrew rather than knowing how to setup your shell properly what will you do on a different box where you can't install homebrew / port / fink etc?
    – paul
    Commented Mar 22, 2015 at 23:53
  • If you can't install Homebrew on a machine you won't have sufficient permissions to install a pkg-based application and run MySQL as a daemon, so your point is moot. In any case, you've made your point and posted your answer. Your dislike of Homebrew for managing packages is noted.
    – Ian C.
    Commented Mar 23, 2015 at 0:15
  • @IanC. mysql is installed by default on many, many systems, like shared webhosting. You get to edit your path and .profile but not install things - doing it the xyz-package-manager way means you don't learn the more portable way. So my point is very pointed. And FYI, I have XCode, fink, macports AND homebrew on my desktop, they are used whenever something needs to be compiled.
    – paul
    Commented Mar 23, 2015 at 0:42
  • 1
    @Thufir: mysqlworkbench is in any case a separate package. You can download it from oracle's website or set it up using homebrew cask, if you prefer to have a scriptable installation. Commented Mar 23, 2015 at 13:22
5

My favourite way to install and run MySQL is via the Homebrew package manager. With Homebrew installed it's as straightforward as:

brew install mysql

This gets you the server and the command line connection tool. It's setup to run with no password, so it's not suitable for production use, but it's perfect for developing with. Homebrew takes care of putting everything you need on your PATH for you, no digging around in .app bundles for binaries.

Once installed, to connect:

mysql -uroot

To have launchd start mysql at login:

ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents

Then you can start it with:

launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

Or if you don't care about having it start on machine boot/restart, you can just run the server directly with:

mysql.server start

The configuration file it reads will be in at /usr/local/etc/my.cnf.

Bonus: having Homebrew on your system puts you one command call away from installing all kinds of other packages. It's a reasonable package manager without a lot of fluff and cruft.

1
  • this is my preferred way of doing things. I've been looking at macports, it's just so many hoops to jump through, depending on OS version, etc, etc. xcode version... Mac would be so much better if homebrew/macports/whatever was just available from the app store..sigh.
    – Thufir
    Commented Mar 23, 2015 at 2:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .