9月 11 2009

Installing MySQL on Snow Leopard

Published by Eiji at 2:25:23 under Mac

Snow Leopard has got PHP 5.3, so it’s nice to install Partuza and Shindig. Because you can do without installing entropy.

But I needed to do a little tweak to get MySQL work on Snow Leopard. Here’s a memo.

Download MySQL

Download binary of MySQL from here. Choose Mac OS 10.5(x86_64) on download list close to the bottom.

Install MySQL

Installing can be done only with GUI. Install Prefpane and Startup Item as well. Configure PATH too.

Create ~/.bash_profile and paste, or append following:

PATH=$PATH:/usr/local/mysql/bin
export PATH

You can utilize it by doing:

> source ~/.bash_profile

Do the tweak

You have to do following to get MySQL properly work on PHP:

>  cd /usr/local/mysql
>  sudo ./script/mysql_install_db

then…

>  sudo cp /etc/php.ini.default /etc/php/ini
>  sudo vim /etc/php.ini

change following part:

mysqli.default_socket = /var/mysql/mysql.sock

to something like this:

mysqli.default_socket = /tmp/mysql.sock

That’s it! Now you should be able to start MySQL from Preference Pane and see MySQL working on PHP.

Note: This makes Partuza working, but if you want to do something else, you may need some more work.

Comments add to hatena hatena.comment (6) add to del.icio.us (0) add to livedoor.clip (0) add to Yahoo!Bookmark (0) Total: 6

blog comments powered by Disqus