Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting MySQL working on OSX 10.7 Lion

Tags:

mysql

macos

I'm currently trying to get MySQL working on OSX 10.7 Lion. I tried the brew way:

brew install mysql
-> cmake        -> no problems
-> make         -> no problems
-> make install -> no problems
-> done

unset TMPDIR
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
Installing MySQL system tables...
/usr/local/bin/mysql_install_db: line 428: 15397 Done                    { echo "use mysql;"; cat $create_system_tables $fill_system_tables; }
 15398 Done(141)               | eval "$filter_cmd_line"
 15401 Segmentation fault: 11  | $mysqld_install_cmd_line > /dev/null
Installation of system tables failed!  Examine the logs in
/usr/local/var/mysql for more information.

Did anyone get mysql to run on Lion?

like image 417
sdepold Avatar asked Jun 11 '11 17:06

sdepold


4 Answers

You can download a MySQL installer as a DMG file, complete with an installer, system preferences pane and a startup script directly from MySQL. Go to MySQL's community server download page, select Mac OS X as the platform and pick the DMG file.

You can skip the registration form (there a little link under the signup form) and you should be on your way.

Once the file is downloaded, double-click on the DMG, launch the installer and complete the installation. After that, install the startup script using its installer and finally the preferences pane by double-clicking on it. I highly recommend choosing to install it for all users on the computer.

You'll find this way much easier than compiling from source.

You should check out Sequel Pro if you need a great OS X tool to manage your MySQL databases.

like image 66
Francois Deschenes Avatar answered Oct 23 '22 12:10

Francois Deschenes


A drop in replacement for mysql is mariadb. You can install with 'brew install mariadb'. It builds on Lion.

Existing mysql drivers and clients just work. I'm using it with python-mysql and django.

It's even called mysql so you won't even know the difference.

like image 37
marxy Avatar answered Oct 23 '22 13:10

marxy


Ha! Got it!

First... download mysql-5.6.2 here: http://dev.mysql.com/downloads/mirror.php?id=402349#mirrors ... once finished, untar the file and do this:

mv path/to/mysql-5.6.2-m5-osx10.6-x86_64 /usr/local/mysql
echo "PATH=\$PATH:/usr/local/mysql/bin" >> ~/.profile
# open a new tab
cd /usr/local/mysql #this is essential!
./scripts/mysql_install_db
mysqld_safe &
mysql -uroot

works for me :)

like image 11
sdepold Avatar answered Oct 23 '22 13:10

sdepold


You need to set up your path environment too, and it's also good practise to set a root password while you're at it. I've created a full step-by-step here: How to install MySQL on Lion (Mac OS X )

like image 2
A4J Avatar answered Oct 23 '22 11:10

A4J