时间:2021-07-01 10:21:17 帮助过:12人阅读
而通过mysql客户端的连接方式mysql -hxx -uxx -pxx databasename -e xxx则毫无问题 而App服务器的netstat -a | grep 3306 | grep TIME_WAIT个数非常小,只有2个。
MySQL在连接超时这块的参数如下
root@(none) 09:24:51>show variables like '%out%'; +------------------------------+----------+ | Variable_name | Value | +------------------------------+----------+ | connect_timeout | 10 | | delayed_insert_timeout | 300 | | handlersocket_timeout | 300 | | handlersocket_wrlock_timeout | 12 | | innodb_lock_wait_timeout | 100 | | innodb_rollback_on_timeout | OFF | | interactive_timeout | 28800 | | lock_wait_timeout | 31536000 | | log_output | FILE | | net_read_timeout | 30 | | net_write_timeout | 60 | | slave_net_timeout | 3600 | | wait_timeout | 28800 | +------------------------------+----------+
最终MM把PHP连接MySQL的连接方式从长连接改成了短连接,就再没出现了。 bitsCN.com