I'm getting a MySQL unix socket error on Zend Server

This seems to only affect servers running Zend Server. The fix is to manually set the socket path in your ./library/config.php file.

'databases' => array (
    'type' => 'mysql',
    'params' => array (
        'mysql' => array (
            'username'    => 'my_username',
            'password'    => 'my_password',
            'host'        => 'localhost',
            'dbname'      => 'my_database',
            'unix_socket' => '/var/run/mysqld/mysqld.sock',    <-- Add this line
        ),
    ),
),