早上来公司,看昨天运行的情况:
2006:MySQL server has gone away
嗯?又是这个错误?为什么要又呢?因为遇到过几次了。解决办法:
- 《 gdb问题解决办法:no debugging symbols found》
- 《解决办法:GLib-ERROR **: Creating pipes for GWakeup: Too many open files》
- 《 mysql多线程访问总结》
了解mysql的一些配置。
网上一查,先登录mysql:
mysql> show global status like 'uptime'; +---------------+--------+ | Variable_name | Value | +---------------+--------+ | Uptime | 268306 | +---------------+--------+ 1 row in set (0.01 sec)
接着再看:
mysql> show global variables like '%timeout'; +-----------------------------+----------+ | Variable_name | Value | +-----------------------------+----------+ | connect_timeout | 10 | | delayed_insert_timeout | 300 | | have_statement_timeout | YES | | innodb_flush_log_at_timeout | 1 | | innodb_lock_wait_timeout | 50 | | innodb_rollback_on_timeout | OFF | | interactive_timeout | 28800 | | lock_wait_timeout | 31536000 | | net_read_timeout | 30 | | net_write_timeout | 60 | | rpl_stop_slave_timeout | 31536000 | | slave_net_timeout | 60 | | wait_timeout | 28800 | +-----------------------------+----------+ 13 rows in set (0.00 sec)
再看:
mysql> show global variables like 'max_allowed_packet'; +--------------------+----------+ | Variable_name | Value | +--------------------+----------+ | max_allowed_packet | 16777216 | +--------------------+----------+ 1 row in set (0.01 sec)