MySql数据库也会睡觉

过一段时间不用,mysql就休眠了,是多久呢?

show global variables like 'wait_timeout';
show session variables like 'wait_timeout';

默认是28800,60608也就是8小时,如果想久一些,比如3天

set global wait_timeout = 259200;
set session wait_timeout = 259200;

看看效果吧

参考:http://wbw3wbw.iteye.com/blog/2244963

标签: none

添加新评论