Leopard/Snow Leopard - mysql_connect() Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’ (2)
by matt on Jul.05, 2009, under Mac OS X Hints
I was setting up my local PHP/MySQL development environment on my local MacBook Pro to mirror our work development setup.
I ran into the following error:
Warning on line 365 of include/lib/adodb/drivers/adodb-mysql.inc.php mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’ (2)
I have fixed this issue in the past on a previous Leopard install, so I thought it was the perfect candidate for a blog post.
Customise php.ini file to use custom MySQL socket
If you have made manual customisations to your php config file already, skip this part; otherwise run the following in Terminal.app:
sudo cp /etc/php.ini.default /etc/php.ini
Next, open Sequel Pro and connect to the mysql server on your local Mac. If you don’t know how to do this, take a look at Getting Connected on the Sequel Pro documentation page.
Then, choose Database > Show Server Variables…
Scroll down through the list of variables until you get to socket.

Open up /etc/php.ini in Textmate or Coda and scroll down the where it says:
; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =
Change the mysql.default_socket line to read:
mysql.default_socket = /tmp/mysql.sock
Restart Web Sharing Service (Apache)
Now, restart your Web Sharing service by going to > System Preferences…
Choose Sharing from the System Preferences page.

On the sharing pane, uncheck Web Sharing, wait a second for it to do its thing, then recheck it. If it was already unchecked, you will just need to choose the checkbox once.

Now, just reload your php page in Safari, and it should hopefully just work. Your app should now be connecting to the local MySQL server on your Mac. Enjoy!
IE6 not invited to the party
by matt on Jul.04, 2009, under Rantings
The amazing artist, John Martz did this piece recently for the website Momentile. You can read about the story/process behind his work at his blog.
Click on the image to see the hi-res version on Flickr.
Jim Breuer
by matt on Jun.24, 2009, under Rantings
Here is some hilarious stand-up content from comedian Jim Breuer:
And another, with Metallica:
Another Micro$oft Ad
by matt on Jun.18, 2009, under Rantings
Microsoft (and hence, me) seem to be pushing out a swarm of product ads recently.
Here is one about Internet Explorer 8 for the pot..
Amusing new ad from Microsoft
by matt on Jun.12, 2009, under Rantings
Stick around for the first 50 seconds of this ad. It’s quite a novel concept for an ad.
Microsoft’s product vision for the future of gaming! [Updated]
by matt on Jun.03, 2009, under Rantings
Any advertisement that features the better part of Joker & The Thief by Wolfmother will steal my attention!
Project Natal, the new project from Microsoft looks to wow the masses with it’s new controller-less interactive gaming/entertainment system.
I saw one of these product vision videos earlier in the year that also had some promising ideas.




