title: MySQL server has gone away error. --max_allowed_packet=2G doesn't work either
body: <p>I am constantly getting the following error while trying to import a MySQL table.</p>
  
  <pre><code>ERROR 2006 (HY000) at line 15692: MySQL server has gone away
  </code></pre>
  
  <p>The error occurs when inserting entries of a table with a longblob field. I have tried everything suggested on the internet, like using <code>--max_allowed_packet</code>, export and import explicity in <code>utf8</code>, exporting in <code>--hex-blob</code>, increasing <code>wait_timeout</code> and <code>interactive_timeout</code> etc, but nothing works!</p>
  
  <p>I dug a bit deeper and noticed that the value of <code>--max_allowed_packet</code> isn't being set properly. I am using LAMPP, and in the file <code>/opt/lampp/etc/my.cnf</code>, I have the following under the [mysqld] section.</p>
  
  <pre><code>max_allowed_packet = 2G
  </code></pre>
  
  <p>However, MariaDB still shows that its value is set to only 1 MB. Why is it like that? I stopped and restarted LAMPP server, but still to no avail. Even setting this parameter from the command line, like as follows, doesnt' work!</p>
  
  <pre><code>/opt/lampp/bin/mysql -h localhost --max_allowed_packet=2G -u root -p
  </code></pre>
  
  <p>In both cases, when I query its value, I get the following.</p>
  
  <pre><code>MariaDB [(none)]&gt; SHOW VARIABLES LIKE 'max_allowed_packet';
  --------------
  SHOW VARIABLES LIKE 'max_allowed_packet'
  --------------
  
  +--------------------+---------+
  | Variable_name      | Value   |
  +--------------------+---------+
  | max_allowed_packet | 1048576 |
  +--------------------+---------+
  </code></pre>
  
  <p>How can I solve this problem? Note that I am logged in as root.</p>