title: MySQL Timeout in XAMPP
body: <p>I have XAMPP installed on Microsoft Windows Server 2003. I have a PHP application in xampp/htdocs directory. I have started the Apache and MySQL instances. </p>
  
  <p>I have noticed that every morning, my application gives a MySQL Error when I try to log in to my application. This is fixed after restarting MySQL instance in XAMPP control panel on the server. I think this may be due to timeout. How do I prevent timeout?</p>
  
  <p>This is the my.ini:</p>
  
  <pre><code>[client] 
  port            = 3306 
  socket          = "D:/xampp/mysql/mysql.sock"
  [mysqld]
  port= 3306
  socket = "D:/xampp/mysql/mysql.sock"
  basedir = "D:/xampp/mysql" 
  tmpdir = "D:/xampp/tmp" 
  datadir = "D:/xampp/mysql/data"
  pid_file = "mysql.pid"
  key_buffer = 16M
  max_allowed_packet = 1M
  sort_buffer_size = 512K
  net_buffer_length = 8K
  read_buffer_size = 256K
  read_rnd_buffer_size = 512K
  myisam_sort_buffer_size = 8M
  log_error = "mysql_error.log"
  plugin_dir = "D:/xampp/mysql/lib/plugin/" 
  
  skip-federated
  
  server-id   = 1
  
  innodb_data_home_dir = "D:/xampp/mysql/data"
  innodb_data_file_path = ibdata1:10M:autoextend
  innodb_log_group_home_dir = "D:/xampp/mysql/data"
  innodb_buffer_pool_size = 16M
  innodb_additional_mem_pool_size = 2M
  innodb_log_file_size = 5M
  innodb_log_buffer_size = 8M
  innodb_flush_log_at_trx_commit = 1
  innodb_lock_wait_timeout = 50
  
  [mysqldump]
  quick
  max_allowed_packet = 16M
  
  [mysql]
  no-auto-rehash
  
  [isamchk]
  key_buffer = 20M
  sort_buffer_size = 20M
  read_buffer = 2M
  write_buffer = 2M
  
  [myisamchk]
  key_buffer = 20M
  sort_buffer_size = 20M
  read_buffer = 2M
  write_buffer = 2M
  
  [mysqlhotcopy]
  interactive-timeout
  </code></pre>
  
  <p>This is the error I come across every morning before restarting MySQL on XAMPP:</p>
  
  <pre><code>Warning: mysql_pconnect(): MySQL server has gone away in D:\MyApplication\mysql.inc on line 432
  
  Warning: mysql_pconnect(): Link to server lost, unable to reconnect in D:\MyApplication\mysql.inc on line 432
  Fatal Error: Failed to connect to database
  </code></pre>