MySQLÓÐËÄÖÖBLOBÀàÐÍ:
MySQLÓÐËÄÖÖBLOBÀàÐÍ:
¡¡¡¡·tinyblob:½ö255¸ö×Ö·û
¡¡¡¡·blob:×î´óÏÞÖƵ½65K×Ö½Ú
¡¡¡¡·mediumblob:ÏÞÖƵ½16M×Ö½Ú
¡¡¡¡·longblob:¿É´ï4GB
¡¡¡¡ÔÚÿ¸öMySQLµÄÎĵµ(´ÓMySQL4.0¿ªÊ¼)µÄ½éÉÜÖÐ,Ò»¸ölongblobÁеÄ×î´óÔÊÐí³¤¶ÈÒÀÀµÓÚÔÚ¿Í»§/·þÎñÆ÷ÐÒéÖпÉÅäÖõÄ×î´ó°üµÄ´óСºÍ¿ÉÓÃÄÚ´æÊý¡£
¡¡¡¡Äã¿ÉÄܶÔÔÚBLOBÖд洢´óÐÍÎļþ·Ç³£½÷É÷£¬µ«ÊÇÇë·ÅÐÄʹÓã¬MYSQLÌṩÁËÕâÑùµÄÁé»îÐÔ£¡×î´ó°üµÄ´óС¿ÉÈÝÒ×µØÖеÄÔÚÅäÖÃÎļþÖÐÉèÖá£ÀýÈç:
Ò»,Windowsͨ¹ýÎļþmy.ini (ÔÚϵͳÅÌ)
[mysqld]
set-variable = max_allowed_packet=10M
¶þ,linuxͨ¹ýetc/my.cnf
[mysqld]
max_allowed_packet = 16M
¡¡¡¡ÄãÄÜÖ¸¶¨¼¸ºõÈκÎÄãÐèÒªµÄ´óС¡£Ä¬ÈÏÊÇ1M¡£
Ïà¹ØÎĵµ£º
ʹÓÃant¹¤¾ß±àÒë³ÌÐò£¬ÔËÐгÌÐò.ÃüÁî:ant -f xxx.xmlÖ¸¶¨Éú³ÉÎļþ£»ant run±àÒë²¢ÔËÐÐÎļþ¡£
Èç¹ûHibernate½«ÖÐÎIJåÈëmysqlÊý¾Ý¿â£¬µ÷ÓÃselectÓï¾äÖÐÎÄÏÔʾÂÒÂ룬ÔòmysqlµÄ±àÂ뷽ʽÉèΪgbk£¬×¢ÒâÕâÀïÊÇСд£¬²»ÓÃÖØа²×°mysqlÊý¾Ý¿â£¬½«MySQL Server 5.1Ŀ¼ÏµÄmy.iniÅäÖÃÎļþÀïµÄËùÓÐdefault-character-setÉèΪgbk£¬× ......
1¡¢Ê¹ÓÃË÷ÒýÀ´¸ü¿ìµØ±éÀú±í¡£
ȱʡÇé¿öϽ¨Á¢µÄË÷ÒýÊÇ·ÇȺ¼¯Ë÷Òý£¬µ«ÓÐʱËü²¢²»ÊÇ×î¼ÑµÄ¡£ÔÚ·ÇȺ¼¯Ë÷ÒýÏ£¬Êý¾ÝÔÚÎïÀíÉÏËæ»ú´æ·ÅÔÚÊý¾ÝÒ³ÉÏ¡£ºÏÀíµÄË÷ÒýÉè¼ÆÒª½¨Á¢ÔÚ¶Ô¸÷ÖÖ²éѯµÄ·ÖÎöºÍÔ¤²âÉÏ¡£Ò»°ãÀ´Ëµ£º
a.ÓдóÁ¿Öظ´Öµ¡¢ÇÒ¾³£Óз¶Î§²éѯ( > ,< £¬> =,< =)ºÍorder by¡¢group by·¢ÉúµÄÁУ¬¿É¿¼Âǽ¨Á¢Èº¼¯Ë÷ ......
ΪʲôÕâô˵ÄØ¡£ÒòΪ°¡ÎÒдÎÒ¹«Ë¾µÄ²éPVµÄÊý¾Ýʱ£¬·¢ÏÖ±íµÄ¹¦Äܲ»ÊǺÜÈ«£¬ÈÃÎÒÓÃÒ»¾ä»°Ð´³öÄÇôÀÏÅ£µÄSQLÓï¾äÕæµÄºÃÄÑ¡£
Õæô×Å°É£¬ÎÒд³öÎÒÕâ¾ä»°À´¿´Ò»¿´¡£
<?php
//########################2010-1-24 22£º48
//#######################Êý¾Ý¿â²éѯ
//######################±¾³ÌÐò¹²ÓÐ3¸ösql·Ö±ðΪsql,sql5,sql ......
ÔÚ¿ª·¢ÏîĿʱ£¬Óöµ½Ò»¸öÎÊÌ⣬¾ÍÊÇÒªËæ»ú¶ÁÈ¡Ò»ÕűíµÄ²¿·Ö¼Ç¼£¬²¢updateÉèÖÃΪ²»¿ÉÔÚ¶Á£¬ÕâÀï¾ÍÓÐÒ»¸öÎÊÌ⣬¿ÉÄܶà¸öÈËͬʱËæ»úµ½ÏàͬµÄ¼Ç¼£¬²¢Öظ´×öupdate²Ù×÷£¬ÒýÆðÊý¾ÝÔà¶ÁºÍÖظ´²Ù×÷£¬
Òò´Ë¿¼ÂǸø±í¼ÓËø¡£µ«ÊDzÉÓÃÁËMyISAM£¬²»Ö§³ÖÊÂÎñ£¬Ö»ÄÜ¼Ó±í¼¶Ëø£¬¶øÇÒ±ðÈËÁ¬¶ÁµÄȨÏÞ¶¼Ã»ÓС£ÏÂÃæÊÇ2¸ö²âÊÔÎļþ£¬ÔÚfiref ......
Á½ÖÖÀàÐÍ×îÖ÷ÒªµÄ²î±ð¾ÍÊÇInnodb Ö§³ÖÊÂÎñ´¦ÀíÓëÍâ¼üºÍÐм¶Ëø.¶øMyISAM²»Ö§³Ö.ËùÒÔMyISAMÍùÍù¾ÍÈÝÒ×±»ÈËÈÏΪֻÊʺÏÔÚСÏîÄ¿ÖÐʹÓá£
ÎÒ×÷ΪʹÓÃMySQLµÄÓû§½Ç¶È³ö·¢£¬InnodbºÍMyISAM¶¼ÊDZȽÏϲ»¶µÄ£¬µ«ÊÇ´ÓÎÒÄ¿Ç°ÔËάµÄÊý¾Ý¿âƽ̨Ҫ´ïµ½ÐèÇó£º99.9%µÄÎȶ¨ÐÔ£¬·½±ãµÄÀ©Õ¹ÐԺ͸߿ÉÓÃÐÔÀ´ËµµÄ»°£¬MyISAM¾ø¶ÔÊÇÎÒµÄÊ×Ñ¡¡£
ÔÒ ......