title: Mysql exception after moving drupal site PDOException: SQLSTATE[HY000] [2013]
body: <p>I just moved my drupal site to another domain/host</p>
  
  <p>I moved the DB and now all my sites. But when I visit the website (juniorsteps.be), I get the following exception:</p>
  
  <blockquote>
    <p>PDOException: SQLSTATE[HY000] [2013] Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in lock_may_be_available() (line 165 of /home/sites/webhosting/juniorsteps/juniorsteps/www/includes/lock.inc).</p>
  </blockquote>
  
  <p>I googled it but I still don't find a solution.</p>
  
  <p>Hope someone can help.</p>
  
  <p>UPDATE</p>
  
  <p>As asked the code from line . It's the first line of the following function:</p>
  
  <pre><code>function lock_may_be_available($name) {
    $lock = db_query('SELECT expire, value FROM {semaphore} WHERE name = :name', array(':name' =&gt; $name))-&gt;fetchAssoc();
    if (!$lock) {
      return TRUE;
    }
    $expire = (float) $lock['expire'];
    $now = microtime(TRUE);
    if ($now &gt; $expire) {
      // We check two conditions to prevent a race condition where another
      // request acquired the lock and set a new expire time. We add a small
      // number to $expire to avoid errors with float to string conversion.
      return (bool) db_delete('semaphore')
        -&gt;condition('name', $name)
        -&gt;condition('value', $lock['value'])
        -&gt;condition('expire', 0.0001 + $expire, '&lt;=')
        -&gt;execute();
    }
    return FALSE;
  }
  </code></pre>
  
  <p>But to be honest I do not think the mistake is in my code since it works perfectly on my development server.</p>