title: MySQL server has gone away on UPDATE (Huge QUERY, around 85MB) using mysli PHP
body: <p>I know this question has been posted / asked <em>many</em> times, and many answers have been given.
  However, to my knowledge, none of them seems to work for now.</p>
  
  <p>So here is the problem:
  When updating on a HUGE query , ~85 MB for single UPDATE query  (please spare me the 'you should reconsider your database design' , not by choice) , PHP gives me the following error : 
  <strong>MySQL server has gone away.</strong></p>
  
  <p>Now, this connection is local (~5 seconds to transfer 85MB)
  (Most of the query update a LONGTEXT field)</p>
  
  <p>Here is my setup :</p>
  
  <p>1 Docker instance running APACHE + PHP 7
  1 Docker instance running mysql 5.7</p>
  
  <p>my.cnf</p>
  
  <pre><code>[mysqld]
  datadir=/var/lib/mysql
  socket=/mysql.sock
  user=root
  # Disabling symbolic-links is recommended to prevent assorted security risks
  symbolic-links=0
  innodb_file_per_table=1
  ft_min_word_len=1
  max_allowed_packet=1G
  
  innodb_buffer_pool_size=1024M
  innodb_log_file_size=512M
  max_connections=10000
  query_cache_size=128M
  skip_name_resolve
  bind-address = 0.0.0.0
  sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
  
  interactive_timeout = 9999
  wait_timeout = 9999
  innodb_lock_wait_timeout = 9999
  net_read_timeout = 9999
  net_write_timeout = 9999
  explicit_defaults_for_timestamp = TRUE
  connect_timeout = 1000000
  net_buffer_length = 256M
  
  [mysqld_safe]
  log-error=/var/log/mysqld.log
  pid-file=/var/run/mysqld/mysqld.pid
  innodb_file_per_table=1
  ft_min_word_len=1
  max_allowed_packet=1G
  
  innodb_buffer_pool_size=1024M
  innodb_log_file_size=512M
  max_connections=10000
  query_cache_size=128M
  skip_name_resolve
  bind-address = 0.0.0.0
  
  interactive_timeout = 9999
  wait_timeout = 9999
  innodb_lock_wait_timeout = 9999
  net_read_timeout = 9999
  net_write_timeout = 9999
  explicit_defaults_for_timestamp = TRUE
  connect_timeout = 1000000
  net_buffer_length = 256M
  
  
  [mysqldump]
  max_allowed_packet = 1G
  </code></pre>
  
  <p>(I'm aware MySQL is running as root &amp; this is bad practice)</p>
  
  <p>I also tried with &amp; without</p>
  
  <pre><code>mysqli.reconnect = On
  </code></pre>
  
  <p>in my php.ini , but didnt work.</p>
  
  <p>Is there any options i am not aware of ?</p>
  
  <p>Thanks again for your time on a such common problem.</p>