Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ʹÓÃC3P0Á¬½ÓMysqlµÄÒ»¸öÎÊÌâµÄ½â¾ö¹ý³Ì


×î½üµÄÒ»¸öÏîÄ¿ÔÚʹÓÃC3P0µÄÁ¬½Ó³Ø£¬Êý¾Ý¿âΪMysql¡£¿ª·¢²âÊÔûÓÐÎÊÌ⣬ÔÚÔËÐÐÖÐÿ¸öÒ»¶Î³¤µÄ¿ÕÏÐʱ¼ä¾Í³öÏÖÒì³£Communications link failure due to underlying exception:
java ´úÂë
²é¿´ÁËMysqlµÄÎĵµ£¬ÒÔ¼°Connector/JµÄÎĵµÒÔ¼°ÔÚÏß˵Ã÷·¢ÏÖ£¬³öÏÖÕâÖÖÒì³£µÄÔ­ÒòÊÇ£º
Mysql·þÎñÆ÷ĬÈϵēwait_timeout”ÊÇ8Сʱ£¬Ò²¾ÍÊÇ˵һ¸öconnection¿ÕÏг¬¹ý8¸öСʱ£¬Mysql½«×Ô¶¯¶Ï¿ª¸Ãconnection¡£Õâ¾ÍÊÇÎÊÌâµÄËùÔÚ£¬ÔÚC3P0 poolsÖеÄconnectionsÈç¹û¿ÕÏг¬¹ý8Сʱ£¬Mysql½«Æä¶Ï¿ª£¬¶øC3P0²¢²»ÖªµÀ¸ÃconnectionÒѾ­Ê§Ð§£¬Èç¹ûÕâʱÓÐClientÇëÇóconnection£¬C3P0½«¸ÃʧЧµÄConnectionÌṩ¸øClient£¬½«»áÔì³ÉÉÏÃæµÄÒì³£¡£
½â¾öµÄ·½·¨ÓÐ3ÖÖ£º
Ôö¼Ówait_timeoutµÄʱ¼ä¡£
¼õÉÙConnection poolsÖÐconnectionµÄlifetime¡£
²âÊÔConnection poolsÖÐconnectionµÄÓÐЧÐÔ¡£
µ±È»×îºÃµÄ°ì·¨ÊÇͬʱ×ÛºÏʹÓÃÉÏÊö3ÖÖ·½·¨£¬¼ÙÉèwait_timeoutΪĬÈϵÄ8Сʱ
C3P0Ôö¼ÓÒÔÏÂÅäÖÃÐÅÏ¢:
//»ñÈ¡connnectionʱ²âÊÔÊÇ·ñÓÐЧ
testConnectionOnCheckin = true
//×Ô¶¯²âÊÔµÄtableÃû³Æ
automaticTestTable=C3P0TestTable
//set to something much less than wait_timeout, prevents connections from going stale
idleConnectionTestPeriod = 18000
//set to something slightly less than wait_timeout, preventing 'stale' connections from being handed out
maxIdleTime = 25000
//if you can take the performance 'hit', set to "true"
testConnectionOnCheckout = true
¸ü¶àµÄÅäÖÃÐÅÏ¢´ó¼Ò¿ÉÒԲ鿴C3P0Îĵµ£¬Connector/JÎĵµ£¬


Ïà¹ØÎĵµ£º

java µ÷ÓÃmysql¿Í»§¶Ëµ¼È룬µ¼³öÊý¾Ý

 ×î½üÓöµ½Ò»¸öÐèÇóÒªÔÚlinuxÏÂÓÃjava µ÷ÓÃmysql¿Í»§¶ËÔ¶³ÌµÇ½mysql·þÎñÆ÷£¬´Ó¿Í»§¶Ë»úÆ÷µ¼Èëmysql½Å±¾£¬´Ómysql·þÎñÆ÷¶Ëµ¼³ö±íÖеÄÊý¾Ý¡£ÒÔÏÂÊÇÓõ½µÄÖ÷Òª·½·¨£º
Java ´úÂë 
/**  
 * µ¼ÈëÊý¾Ý  
  * @param  ½Å±¾µÄµØÖ·ºÍÃû³Æ  
 * @return ÊÇ·ñ³ ......

mysql °²×°

http://blog.csdn.net/digyso888/archive/2008/12/18/3552981.aspx
 MySQL°²×°µÄͼ½â5.0.28 ÊÕ²Ø
MySQL°²×°µÄͼ½â£¨×îа棩¡¡¡¡´ò¿ªÏÂÔصÄmysql°²×°Îļþmysql-5.0.27-win32.zip£¬Ë«»÷½âѹËõ£¬ÔËÐГsetup.exe”£¬³öÏÖÈçϽçÃ棺
¡¡¡¡mysql°²×°Ïòµ¼Æô¶¯£¬°´“Next”¼ÌÐø
 
¡¡¡¡Ñ¡Ôñ° ......

C++/Cºê¶¨ÒåÖÐ## Á¬½Ó·ûÓë# ·ûµÄº¬Òå

## Á¬½Ó·ûÓë# ·û
¡¡¡¡## Á¬½Ó·ûºÅÓÉÁ½¸ö¾®ºÅ×é³É£¬Æ书ÄÜÊÇÔÚ´ø²ÎÊýµÄºê¶¨ÒåÖн«Á½¸ö×Ó´®(token)Áª½ÓÆðÀ´£¬´Ó¶øÐγÉÒ»¸öеÄ×Ó´®¡£µ«Ëü²»¿ÉÒÔÊǵÚÒ»¸ö»òÕß×îºóÒ»¸ö×Ó´®¡£ËùνµÄ×Ó´®(token)¾ÍÊÇÖ¸±àÒëÆ÷Äܹ»Ê¶±ðµÄ×îСÓï·¨µ¥Ôª¡£¾ßÌåµÄ¶¨ÒåÔÚ±àÒëÔ­ÀíÀïÓÐÏ꾡µÄ½âÊÍ£¬µ«²»ÖªµÀÒ²ÎÞËùν¡£Í¬Ê±ÖµµÃ×¢ÒâµÄÊÇ#Á¬½Ó·ûÊÇ°Ñ´«µÝ¹ý ......

LinuxÏÂc¿ª·¢ Ö® Ïß³ÌͨÐÅ

1.Linux“Ï߳̔
     ½ø³ÌÓëÏß³ÌÖ®¼äÊÇÓÐÇø±ðµÄ£¬²»¹ýLinuxÄÚºËÖ»ÌṩÁËÇáÁ¿½ø³ÌµÄÖ§³Ö£¬Î´ÊµÏÖÏß³ÌÄ£ÐÍ¡£LinuxÊÇÒ»ÖÖ“¶à½ø³Ìµ¥Ï߳̔µÄ²Ù×÷ϵͳ¡£Linux±¾ÉíÖ»Óнø³ÌµÄ¸ÅÄ¶øÆäËùνµÄ“Ï߳̔±¾ÖÊÉÏÔÚÄÚºËÀïÈÔÈ»Êǽø³Ì¡£
     ´ó¼Ò ......

mysql ÃüÁî

1¡¢MySQL³£ÓÃÃüÁî
create database name; ´´½¨Êý¾Ý¿â
use databasename; Ñ¡ÔñÊý¾Ý¿â
drop database name Ö±½Óɾ³ýÊý¾Ý¿â£¬²»ÌáÐÑ
show tables; ÏÔʾ±í
describe tablename; ±íµÄÏêϸÃèÊö
select ÖмÓÉÏdistinctÈ¥³ýÖظ´×Ö¶Î
mysqladmin drop databasename ɾ³ýÊý¾Ý¿âÇ°£¬ÓÐÌáʾ¡£
ÏÔʾµ±Ç°mysql°æ±¾ºÍµ±Ç°È ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ