Max Glenister

Software & Servers • 1 min read Plain text

Installing MySQL on OS X Mountain Lion

I was having some issues getting MySQL installed on OS X 10.8 Mountain Lion, and then I came across a useful article describing how to do it.

Here’s the important information from the article to install MySQL on OS X 10.8 Mountain Lion using Homebrew:

Install Homebrew

$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

Install MySQL using Homebrew

$ brew install mysql

Add MySQL to your LaunchAgents, so it can launch on startup

$ mkdir -p ~/Library/LaunchAgents
$ cp /usr/local/Cellar/mysql/5.5.27/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
$ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

Unset TMPDIR (as this isn’t set to /tmp for non-root users) and install the MySQL system tables

$ unset TMPDIR
$ mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp

Set the root password for MySQL

$ /usr/local/Cellar/mysql/5.5.27/bin/mysqladmin -u root password 'YOUR_NEW_PASSWORD'

And lastly, start MySQL

$ mysql.server start
  • Software & Servers · shares #database
    Making Postgres work nicely on OS X Mountain Lion

    Postgres on OS X has been a pain in the ass for as long as I have had to use it. To start with, the version that comes with OS X is old, so I’ve always had to replace it with a better version.

    October 2013 • 3 min read
  • UX & Design · shares #macos
    Making GIMP feel less like punishment

    GIMP has always had an interface problem. I’m not blaming the GIMP team (they’ve built something powerful on a shoestring). They’ve been clear they’re not interested in copying Photoshop wholesale; their FAQ argues that designing around actual user research beats imitating someone else’s interface decisions. Fair enough in principle, but coming from years as a Photoshop user, that design still feels hostile to me. I’m just one user story out of many they’ve had to design for, but it still expects me to learn its own way of doing things rather than offering a config closer to what I’m used to out of the box.

    June 2026 • 2 min read
  • Software & Servers · shares #guide
    Replacing the macOS audio switcher with SwiftBar

    The built-in audio output menu in macOS has always felt a bit limited. The icons aren’t very helpful, the device names can’t be customised, and if you’ve got a few different outputs, it becomes tricky to quickly tell what’s what.

    October 2025 • 3 min read

Discussion

  • RB

    Thanks for linking to the article. Glad you found it useful!

  • P

    thanks, but where is my.cnf? How to config remote access

  • SM

    Thanks!! works!

  • JD

    Thanks, I was missing the -w in launchctl that was driving me crazy

  • A

    using mysql_install_db –verbose –user=whoami –basedir=”$(brew –prefix mysql)” –datadir=/usr/local/var/mysql –tmpdir=/tmpI get an error: -bash: mysql_install_db: command not found

Comments are closed

You can still reply from your own site with a Webmention.

Webmentions last fetched 8 November 2026, 07:10