解决方案 »
- 很简单的Mysql问题条件查询
- Servlet+JDBC+MySQL乱码
- mysql 多条记录合并成一条
- 有一个问题,就是表中列太多会有什么问题?
- 请大家帮忙看看,使用mysql connector/c++ 往数据库中插入blob字段出1210错
- set names 'xxx'
- 一个统计字符在该字段中出现的次数的方法 需帮改进
- 一个比较难的SQL语句,大家能帮忙看看吗?
- 在大学毕业的时候,计算机专业方面应该学的“精”点好,还是学的“广”点好?
- 我要做自增型的字符串,该怎么做?
- mysql+tomcat,mysql的查询结果,中文全显示为乱码,jsp中的中文能正常显示,但从mysql经tomcat查询而来的结果显示为乱码.
- 查看表空间物理文件的名称及大小!怎么理解
还有看看back_log这个参数对你是否有帮助
connection refused,从配置上来看 不是max_connections的问题,19,176 milliseconds ago大概是5小时,但是这时最后一次!你重启然后再连接试一下。
http://mysqlblog.fivefarmers.com/2010/09/06/debugging-communication-link-failure-exceptions-in-connectorj/
文章应该可以帮你。
The number of seconds that the mysqld server waits for a connect packet before responding with Bad handshake.
interactive_timeout
The number of seconds the server waits for activity on an interactive connection before closing it.
wait_timeout
The number of seconds the server waits for activity on a noninteractive connection before closing it.
net_read_timeout
The number of seconds to wait for more data from a connection before aborting the read.
net_write_timeout
The number of seconds to wait for a block to be written to a connection before aborting the write.从以上解释可以看出,connect_timeout在获取连接阶段(authenticate)起作用,interactive_timeout和wait_timeout在连接空闲阶段(sleep)起作用,而net_read_timeout和net_write_timeout则是在连接繁忙阶段(query)起作用。获取MySQL连接是多次握手的结果,除了用户名和密码的匹配校验外,还有IP->HOST->DNS->IP验证,任何一步都可能因为网络问题导致线程阻塞。为了防止线程浪费在不必要的校验等待上,超过connect_timeout的连接请求将会被拒绝。即使没有网络问题,也不能允许客户端一直占用连接。对于保持sleep状态超过了wait_timeout(或interactive_timeout,取决于CLIENT_INTERACTIVE标志)的客户端,MySQL会主动断开连接。即使连接没有处于sleep状态,即客户端忙于计算或者存储数据,MySQL也选择了有条件的等待。在数据包的分发过程中,客户端可能来不及响应(发送、接收、或者处理数据包太慢)。为了保证连接不被浪费在无尽的等待中,MySQL也会选择有条件(net_read_timeout和net_write_timeout)地主动断开连接。这么多Timeout足以证明MySQL是多么乐于断开连接。而乐于断开连接的背后,主要是为了防止服务端共享资源被某客户端(mysql、mysqldump、页面程序等)一直占用。
这个也可能对你解决问题有益!
max_connections=1020
thread_cache_size=128
query_cache_size=1073741824
back_log=500
connect_timeout=600
innodb_open_files=1000
结贴