title: Magento keep throwing SQLState no such file or directory error
body: <p>I am running magento on VPS server with APC enabled, nginx reverse proxy and apache with MYSQL. But I keep getting this error on report folder and sometimes site is down due to that. Can you please guide me how can i fix it. There's no funny xml file inside app/etc/ as well. Thank you.</p>
  
  <pre><code>a:4:{i:0;s:48:"SQLSTATE[HY000] [2002] No such file or directory";i:1;s:3103:"#0 /home/magen/public_html/shop/lib/Zend/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract-&gt;_connect()
  #1 /home/magen/public_html/shop/lib/Varien/Db/Adapter/Pdo/Mysql.php(313): Zend_Db_Adapter_Pdo_Mysql-&gt;_connect()
  #2 /home/magen/public_html/shop/lib/Zend/Db/Adapter/Abstract.php(459): Varien_Db_Adapter_Pdo_Mysql-&gt;_connect()
  #3 /home/magen/public_html/shop/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract-&gt;query('SET NAMES utf8', Array)
  #4 /home/magen/public_html/shop/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract-&gt;query('SET NAMES utf8', Array)
  #5 /home/magen/public_html/shop/app/code/core/Mage/Core/Model/Resource.php(169): Varien_Db_Adapter_Pdo_Mysql-&gt;query('SET NAMES utf8')
  #6 /home/magen/public_html/shop/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource-&gt;_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
  #7 /home/magen/public_html/shop/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource-&gt;getConnection('core_write')
  #8 /home/magen/public_html/shop/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract-&gt;_getConnection('write')
  #9 /home/magen/public_html/shop/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract-&gt;_getWriteAdapter()
  #10 /home/magen/public_html/shop/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(360): Mage_Core_Model_Resource_Db_Abstract-&gt;_getReadAdapter()
  #11 /home/magen/public_html/shop/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(134): Mage_Core_Model_Resource_Db_Abstract-&gt;getReadConnection()
  #12 /home/magen/public_html/shop/app/code/core/Mage/Core/Model/Config.php(1348): Mage_Core_Model_Resource_Db_Collection_Abstract-&gt;__construct(Object(Mage_Core_Model_Resource_Website))
  #13 /home/magen/public_html/shop/app/code/core/Mage/Core/Model/Config.php(1380): Mage_Core_Model_Config-&gt;getModelInstance('core_resource/w...', Object(Mage_Core_Model_Resource_Website))
  #14 /home/magen/public_html/shop/app/Mage.php(490): Mage_Core_Model_Config-&gt;getResourceModelInstance('core/website_co...', Object(Mage_Core_Model_Resource_Website))
  #15 /home/magen/public_html/shop/app/code/core/Mage/Core/Model/Abstract.php(208): Mage::getResourceModel('core/website_co...', Object(Mage_Core_Model_Resource_Website))
  #16 /home/magen/public_html/shop/app/code/core/Mage/Core/Model/Abstract.php(213): Mage_Core_Model_Abstract-&gt;getResourceCollection()
  #17 /home/magen/public_html/shop/app/code/core/Mage/Core/Model/App.php(608): Mage_Core_Model_Abstract-&gt;getCollection()
  #18 /home/magen/public_html/shop/app/code/core/Mage/Core/Model/App.php(466): Mage_Core_Model_App-&gt;_initStores()
  #19 /home/magen/public_html/shop/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Model_App-&gt;_initCurrentStore('', 'store')
  #20 /home/magen/public_html/shop/app/Mage.php(683): Mage_Core_Model_App-&gt;run(Array)
  #21 /home/magen/public_html/shop/index.php(87): Mage::run('', 'store')
  #22 {main}";s:3:"url";s:6:"/shop/";s:11:"script_name";s:15:"/shop/index.php";}
  </code></pre>