2011年2月7日 星期一

[MySQL特有語法] 變更Table欄位順序

0 意見
代碼:
ALTER TABLE tbl_name CHANGE [COLUMN] old_col_name column_definition [FIRST|AFTER col_name]

範例:
number1 column:varchar(64) default NULL 在 number2 column 之前,現在要將number1搬到number2之後。

alter table test change column number1 number1 varchar(64) default NULL after number2;

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

0 意見
如果你的程式使用了太多的 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 註冊表,重開機後即可增加連線數量。

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