Home > Mac, Tech Tips, Technology > Zend Server 4.0.6 + Framework 1.9 and PDO_MYSQL on Mac OS X always defaults to /temp/mysql.sock

Zend Server 4.0.6 + Framework 1.9 and PDO_MYSQL on Mac OS X always defaults to /temp/mysql.sock


I always get an error like the one below when I first run Zend Server with a Zend Framework 1.9 app.

Fatal error: Uncaught exception ‘Zend_Db_Adapter_Exception’
with message ‘SQLSTATE[HY000] [2002] Can’t connect to local
MySQL server through socket ‘/tmp/mysql.sock’

Of course, recompiling PHP and so on might fix it, but I found, for time’s sake, it’s simpler to just to issue the command from the terminal. (You’ll need to be admin or know an admin’s password).

sudo ln -s /usr/local/zend/mysql/tmp/mysql.sock /tmp/mysql.sock

If you’re fed up of running this command every time you log in, just download Lingon and create a task that runs automatically on boot or login.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: