title: Fix error mysql server has gone away
body: <p>My VPS very often fails to <em>"MySQL server has gone away (error 2006)"</em> and loses connection. I have increased the value of the variable in my.cnf but the condition did not improve. Here is my.cnf:   </p>
  
  <pre><code>[mysqld]
  port            = 3306
  socket          = /var/lib/mysql/mysql.sock
  default-storage-engine=myisam
  datadir=/var/lib/mysql
  old_passwords=1
  skip-bdb
  skip-innodb
  max_allowed_packet = 256M
  table_cache= 512M
  wait_timeout = 180
  max_connections = 2000
  net_read_timeout= 180
  query_cache_size = 512M
  query_cache_limit = 512M
  max_user_connections=300
  
  [client] 
  socket=/var/lib/mysql/mysql.sock
  max_allowed_packet = 128M
  [mysqld_safe]
  log-error=/var/log/mysqld.log
  pid-file=/var/run/mysqld/mysqld.pid
  </code></pre>