title: Connection Failed: 2002
body: <p>I recently moved my mysql directory as it was filling up the partition.</p>
  
  <p>I went ahead and updated my.cnf with the new datadir.</p>
  
  <p>Then i went ahead and updated my php.ini default_socket (mysqli &amp; mysql) to the new location and restarted apache. Yet every time a cron (php script) runs that does an mysqli update on a table i get:</p>
  
  <blockquote>
    <p>Connection Failed: 2002</p>
  </blockquote>
  
  <p>Should i be including the full path including filename or just the path.</p>
  
  <blockquote>
    <p>/home/mysql/mysql.sock</p>
  </blockquote>
  
  <p>Error Log:</p>
  
  <blockquote>
    <p>[26-Feb-2014 11:30:01 America/New_York] PHP Warning:  mysqli::mysqli(): (HY000/2002): Can't connect to local MySQL server through socket '/home/mysql/mysql.sock' (2) in /home/user/public_html/models/db-settings.php on line 21</p>
  </blockquote>