Home >Database >Mysql Tutorial >解决MySQL数据库拒绝服务的小方法_MySQL

解决MySQL数据库拒绝服务的小方法_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:54:361077browse

    下文中将具体讲述处理的方法:

    1.使用Mysql 4.0或4.1版本,如果没有用到Mysql 5的一些新特性比如存储过程触发器之类。

    2.定时重启Mysql服务器或Ser(由于本问题可能同样会影响到其它一些需要Mysql支持的服务器程序,所以重启Mysql服务器为好,但需要检测Mysql服务器不被使用的一个时间重启比较难确定)

    3.设置my.cnf,有mysqld字段内增加参数:

    [mysqld]port = 3306socket = /tmp/mysql.sockwait_timeout= 500000interactive_timeout = 500000(500000秒约五六天的超时时间,可根据实际需要选择一个数据库可能空闲的最长时间稍大的时间值。)重启Mysqld应用即可,也可以在执行mysqld时加-o wait_timeout=500000参数同样效果。

    在MySQL客户端show variable时应该可以看到最后一条从默认的wait_time=28000变成500000了。

    注:假如重启Mysqld不生效,可以重启机子。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn