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:
$ 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
Related posts
- 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.
- 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.
- 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.
Discussion
- 2012
- RB
Thanks for linking to the article. Glad you found it useful!
- P
thanks, but where is my.cnf? How to config remote access
- 2013
- SM
Thanks!! works!
- JD
Thanks, I was missing the -w in launchctl that was driving me crazy
- 2014
- 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.
