Home » Mysql » Getting MySQL working on OSX 10.7 Lion

Getting MySQL working on OSX 10.7 Lion

Posted by: admin November 1, 2017 Leave a comment

Questions:

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?

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.

Questions:
Answers:

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.

Questions:
Answers:

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 🙂

Questions:
Answers:

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 )

Questions:
Answers:

All,

I was having issues with connecting to my DB through Tomcat, yet could through the MySql tool. Tomcat was accessing it through the actual IP of my machine (10.0.x.x) instead of through localhost or 127.0.0.1. Turns out that when I migrated from SL to Lion, remote connections were disabled. Once I enabled them, it worked fine.

Hopefully this helps someone.

Questions:
Answers:

I had MySQL installed already, but after upgrading to Lion it would no longer start.

I tried installing the latest official version and it still wouldn’t start.

Finally, this fixed it:

$ sudo mkdir /var/log/mysql
$ sudo chown mysql:mysql /var/log/mysql