title: Large insert query and "MySQL server has gone away"
body: <p>i have a large(for example 4500 line) <strong>INSERT QUERY</strong> in my <strong>php</strong> code and when this Query want to <strong>execute in mysql</strong> and insert its value, this error occur:</p>
  
  <blockquote>
    <p>PDO::exec(): MySQL server has gone away in ...</p>
  </blockquote>
  
  <p>or </p>
  
  <blockquote>
    <p>PDO::exec(): Error reading result set's header</p>
  </blockquote>
  
  <p>i tried this large query is divided into several small query and execute them but this error occur again.</p>
  
  <p>i know this : </p>
  
  <blockquote>
    <p>max_allowed_packet    1048576</p>
  </blockquote>
  
  <p>but it does not work.</p>