XAMPP中的MySQL超时

时间:2015-07-14 04:57:44

标签: php mysql xampp

我在Microsoft Windows Server 2003上安装了XAMPP。我在xampp / htdocs目录中有一个PHP应用程序。我已经启动了Apache和MySQL实例。

我注意到每天早上,当我尝试登录我的应用程序时,我的应用程序会出现MySQL错误。在服务器上的XAMPP控制面板中重新启动MySQL实例后,这已得到修复。我想这可能是由于超时。如何防止超时?

这是my.ini:

[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

这是我每天早上在XAMPP上重启MySQL之前遇到的错误:

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

0 个答案:

没有答案