作者hirabbitt (兔子)
看板PHP
標題Re: [閒聊] Mysql_close 的必要性
時間Fri Aug 6 16:03:15 2010
※ 引述《JYHuang (夏天到了,冷不起來了說)》之銘言:
: 標題: [閒聊] Mysql_close 的必要性
: 時間: Sun May 13 01:04:23 2007
:
:
: 我手上的書寫說script結束時會自動關閉mysql_connect()產生的connection
:
: 所以說一頁php裡有沒有放mysql_close的差別並不大嗎?
:
: 大家都會在php的結尾還是讀完資料後就把連線關掉嗎?
:
: --
: ※ 發信站: 批踢踢實業坊(ptt.cc)
: ◆ From: 59.104.203.252
: 推 shingoliang:一般是會自己關掉@@" 05/13 14:03
: 推 JYHuang:我是說大家會加上mysq_close這個語法嗎? ^^" 05/13 14:12
: 推 jim221:我都沒關= ="話說那個mysql_free_result也沒在用XDD 05/13 15:51
: 推 f916101:我還是都有加,有頭有尾@@ 05/13 16:44
: 推 PHP5:舉個爛例子: 大完使要擦屁屁,沒擦也不會怎樣 XD 05/14 03:32
: → PHP5: 便 05/14 03:33
嗯...我就是沒關的那一個
但是現在出現了警告
Warning: mysql_connect() [function.mysql-connect]: Too many connections in...
是不是因為沒有關的原因呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 163.13.127.91
→ hirabbitt:順便請教一下 現在要怎麼辦? 只能等它時間到了後自動釋 08/06 16:04
→ hirabbitt:放嗎? 08/06 16:04
推 shadowjohn:mysql_query("SET GLOBAL max_connections=1024"); 08/06 19:11
→ shadowjohn:這支放到include裡吧~ 08/06 19:12
→ hirabbitt:可是現在連 連線 都上不去了耶 08/06 19:42
→ iFEELing: call your dba or restart mysql 08/08 01:05
→ JeffMcBride:就是因為沒close 08/08 17:12