title: MARIADB - Error while sending QUERY packet (not max_allowed_packet)
body: <p>I'm having an issue with a PHP7 script saving data to a database (MariaDB). The script worked fine on a previous hosting package, but not on my new VPS.</p>
  
  <pre><code>Warning: Error while sending QUERY packet. PID=1208 in ...
  </code></pre>
  
  <p>Other threads caused me to look at settings, but my settings are:</p>
  
  <ul>
  <li>max_allowed_packet = 1GB</li>
  <li>wait_timeout = 10</li>
  </ul>
  
  <p>I've reviewed the issue further and found there is nothing wrong with the query itself (it executes fine in phpMyAdmin). </p>
  
  <p><strong>It seems to be something to do with executing two queries in close succession without closing the connection (the second one fails)</strong>. </p>
  
  <p>The same script ran fine on the old hosting, it must be a setting - does anyone have any ideas?</p>
  
  <p>Many thanks,
  Ben</p>
  
  <p>MariaDB config (/etc/my.cnf):</p>
  
  <pre><code>datadir=/var/lib/mysql
  socket=/var/lib/mysql/mysql.sock
  symbolic-links=0
  
  skip-external-locking
  key_buffer_size = 16M
  max_allowed_packet = 1GB
  table_open_cache = 64
  sort_buffer_size = 512K
  net_buffer_length = 8K
  read_buffer_size = 256K
  read_rnd_buffer_size = 512K
  myisam_sort_buffer_size = 8M
  
  innodb_file_per_table
  
  max_connections=70
  max_user_connections=30
  wait_timeout=10
  interactive_timeout=50
  long_query_time=5
  </code></pre>