Archive for category Mac

Got an “Error establishing a database connection” in Mac OS X 10.6?

At some point in the last month (been on holiday mostly) an Apple system update caused MySQL to stop running – all local development sites using MySQL would give the dreaded “Error establishing a database connection” error message. And phpMyAdmin refused to recognize my user/pass credentials.

It seems that Apple has once more made it necessary to explicitly state the MySQL default socket. As stated in this post Mac, WordPress: “Error establishing a database connection” you should edit the mysql.default_socket = line in your php.ini file to read mysql.default_socket = /tmp/mysql.sock

If you don’t know where to look it’s to be found in an invisible folder at the root of your hard drive called “etc”. To get there go to the menu bar when in the Finder: Go -> Go to Folder… or use this shortcut: [Apple]+[Shift]+G ) then type: /etc .

I’d recommend the excellent (and free) TextWranger to edit the file – as it makes it a breeze by automatically authorizing your changes with a prompt for you admin password when needed.

The change is easy – find the line that reads mysql.default_socket = then add /tmp/mysql.sock to the end.

The line should now read  mysql.default_socket = /tmp/mysql.sock

Save the file the restart your Apache webserver by going the System Preferences and stopping, then starting again Web Sharing (found in the Sharing pane).

1 Comment

Safari: how to restore all windows from last session using Time Machine

It’s really very simple – everything you need is in ~/Libaray/Safari/LastSession.plist just quit Safari and restore that file from when it was good and you’re done.

What’s this about?

Well I tend to use open Safari windows/tabs to help keep me focused on foreground tasks while minimising backround/interesting/to-do articles etc. Occasionally I forget to restore all my windows after restarting Safari for a quick session (usually whilst preparing for shutdown/restart/software update).

Next time you try to restore all your windows and don’t get what you expected – remind yourself this is why that extra Time Machine disk was such a useful investment.

Hope this helps.

No Comments

Quick and dirty DVD editing in iMovie

Got your own content want to re-edit quick-like using iMovie. Use MPEG Streamclip to export to MPEG-4. Import into iMovie. Edit.

,

No Comments

Font management on Mac OS X by Linotype

Thanks to guns for for making me aware of FontExplorer in the comment on this thread on how to organize fonts using Font Book over at Mac OS X Hints. FontExplorer looks great; the price certainly is. Must give it a good look when I get a chance.

No Comments

In-cell editing in MS Excel for Mac

Gold old Mac OS X Hints. I’ve looked for this shortcut several times over the last fifteen years across versions – never found it. Not online or in the Help files. Here it is: Control-U. GRRRREAT!

No Comments