2011年2月7日 星期一

使用 MySQL 時遇到 Can't connect to MySQL server 問題…


如果你的程式使用了太多的 mysqlpp::Connection 物件,會導致你的系統殘存太多的 TCP Connection 在 TIME_WAIT,一旦系統有超過可使用的數量,則會導致無法在建立連線,進而導致 mysqlpp::Connection 無法連線到 mysql 伺服器。

針對此問題,mysql 官方手冊有提到如何對應:

2 Connection to MySQL Server Failing on Windows

When you're running a MySQL server on Windows with many TCP/IP connections to it, and you're experiencing that quite often your clients get a Can't connect to MySQL server error, the reason might be that Windows doesn't allow for enough ephemeral (short-lived) ports to serve those connections. ... 閱讀全文

跟著文章的方式修改 reg 註冊表,重開機後即可增加連線數量。

0 意見:

張貼留言

Followers

 

Spark的技術心得分享. Copyright 2009 All Rights Reserved Free Wordpress Themes by Brian Gardner Free Blogger Templates presents HD TV Watch Shows Online. Unblock through myspace proxy unblock, Songs by Christian Guitar Chords