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

Óà OPTIMIZE TABLE ÓÅ»¯ mysql ±í


Óà OPTIMIZE TABLE ÓÅ»¯ mysql ±í
ʱ¼ä:2010-2-28À´Ô´:HaCMS¿ªÔ´ÉçÇø ×÷Õß:gangzhong
REPAIR TABLE `table_name` ÐÞ¸´±í OPTIMIZE TABLE `table_name` ÓÅ»¯±í myisamchk table.MYI ÐÞ¸´Ë÷Òý REPAIR TABLE ÓÃÓÚÐÞ¸´±»ÆÆ»µµÄ±í¡£ myisamchk TABLE.MYI ÓÃÓÚÐÞ¸´±»ÆÆ»µµÄË÷ÒýÎļþ¡£ OPTIMIZE TABLE ÓÃÓÚ»ØÊÕÏÐÖõÄÊý¾Ý¿â¿Õ¼ä£¬µ±±íÉϵÄÊý¾ÝÐб»É¾³ýʱ£¬ËùÕ¼¾ÝµÄ ...
REPAIR TABLE `table_name` ÐÞ¸´±í OPTIMIZE TABLE `table_name` ÓÅ»¯±í myisamchk table.MYI ÐÞ¸´Ë÷Òý REPAIR TABLE ÓÃÓÚÐÞ¸´±»ÆÆ»µµÄ±í¡£ myisamchk TABLE.MYI ÓÃÓÚÐÞ¸´±»ÆÆ»µµÄË÷ÒýÎļþ¡£ OPTIMIZE TABLE ÓÃÓÚ»ØÊÕÏÐÖõÄÊý¾Ý¿â¿Õ¼ä£¬µ±±íÉϵÄÊý¾ÝÐб»É¾³ýʱ£¬ËùÕ¼¾ÝµÄ´ÅÅ̿ռ䲢ûÓÐÁ¢¼´±»»ØÊÕ£¬Ê¹ÓÃÁËOPTIMIZE TABLEÃüÁîºóÕâЩ¿Õ¼ä½«±»»ØÊÕ£¬²¢ÇÒ¶Ô´ÅÅÌÉϵÄÊý¾ÝÐнøÐÐÖØÅÅ£¨×¢Ò⣺ÊÇ´ÅÅÌÉÏ£¬¶ø·ÇÊý¾Ý¿â£©¡£ ¶àÊýʱ¼ä²¢²»ÐèÒªÔËÐÐOPTIMIZE TABLE£¬Ö»ÐèÔÚÅúÁ¿É¾³ýÊý¾ÝÐÐÖ®ºó£¬»ò¶¨ÆÚ£¨Ã¿ÖÜÒ»´Î»òÿÔÂÒ»´Î£©½øÐÐÒ»´ÎÊý¾Ý±íÓÅ»¯²Ù×÷¼´¿É£¬Ö»¶ÔÄÇЩÌض¨µÄ±íÔËÐУ¬Õâ¸ö²Ù×÷¶ÔÓÚÓÎÏ·Êý¾Ý¿âÖеÄijЩ±íÌرðÆð×÷Óã¬ÕâЩ±í»ù±¾ÉÏÐèҪÿÖÜ×öÒ»´ÎÓÅ»¯£¬ÉõÖÁÒ»ÖÜÁ½´Î¡£ OPTIMIZE [LOCAL | NO_WRITE_TO_BINLOG] TABLEtbl_name[,tbl_name] ... Èç¹ûÄúÒѾ­É¾³ýÁ˱íµÄÒ»´ó²¿·Ö£¬»òÕßÈç¹ûÄúÒѾ­¶Ôº¬Óпɱ䳤¶ÈÐÐµÄ±í£¨º¬ÓÐVARCHAR, BLOB»òTEXTÁÐµÄ±í£©½øÐÐÁ˺ܶà¸ü¸Ä£¬ÔòӦʹÓÃOPTIMIZE TABLE¡£±»É¾³ýµÄ¼Ç¼±»±£³ÖÔÚÁ´½ÓÇåµ¥ÖУ¬ºóÐøµÄINSERT²Ù×÷»áÖØÐÂʹÓþɵļǼλÖá£Äú¿ÉÒÔʹÓÃOPTIMIZE TABLEÀ´ÖØÐÂÀûÓÃδʹÓõĿռ䣬²¢ÕûÀíÊý¾ÝÎļþµÄËéƬ¡£ÔÚ¶àÊýµÄÉèÖÃÖУ¬Äú¸ù±¾²»ÐèÒªÔËÐÐOPTIMIZE TABLE¡£¼´Ê¹Äú¶Ô¿É±ä³¤¶ÈµÄÐнøÐÐÁË´óÁ¿µÄ¸üУ¬ÄúÒ²²»ÐèÒª¾­³£ÔËÐУ¬Ã¿ÖÜÒ»´Î»òÿÔÂÒ»´Î¼´¿É£¬Ö»¶ÔÌض¨µÄ±íÔËÐС£ OPTIMIZE TABLEÖ»¶ÔMyISAM, BDBºÍInnoDB±íÆð×÷Ó᣶ÔÓÚMyISAM±í£¬OPTIMIZE TABLE°´ÈçÏ·½Ê½²Ù×÷£º 1. Èç¹û±íÒѾ­É¾³ý»ò·Ö½âÁËÐУ¬ÔòÐÞ¸´±í¡£ 2. Èç¹ûδ¶ÔË÷ÒýÒ³½øÐзÖÀ࣬Ôò½øÐзÖÀà¡£ 3. Èç¹û±íµÄͳ¼ÆÊý¾ÝûÓиüУ¨²¢ÇÒͨ¹ý¶ÔË÷Òý½øÐзÖÀ಻ÄÜʵÏÖÐÞ¸´£©£¬Ôò½øÐиüС£¶ÔÓÚBDB±í£¬OPTIMIZE TABLEÄ¿Ç°±»Ó³Éäµ½ANALYZE TABLEÉÏ¡£¶ÔÓÚInnoDB±í£¬OPTIMIZE TABLE±»Ó³Éäµ½ALTER TABLEÉÏ£¬Õâ»áÖؽ¨±í¡£Öؽ¨²Ù×÷ÄܸüÐÂË÷Òýͳ¼ÆÊý¾Ý²¢ÊͷųɴØË÷ÒýÖеÄδʹÓõĿռ䡣Çë²Î¼û13.5.2.1½Ú£¬“ANALYZE TABLEÓï·¨”¡£Ê¹ÓÃ?skip-new»ò?safe-modeÑ¡Ïî¿ÉÒÔÆô¶¯mysqld¡£Í¨¹ýÆô¶¯mysqld£¬Äú¿ÉÒÔʹ


Ïà¹ØÎĵµ£º

mysqlÊý¾ÝUnixʱ¼ä´ÁÓëC# DateTimeʱ¼äÀàÐÍ»¥»»

Unixʱ¼ä´Á×îСµ¥Î»ÊÇÃ룬¿ªÊ¼Ê±¼äΪ¸ñÁÖÍþÖαê׼ʱ¼ä1970-01-01 00:00:00
ConvertIntDateTime·½·¨µÄ»ù±¾Ë¼Â·ÊÇͨ¹ý»ñÈ¡±¾µØʱÇø±íʾUnixk¿ªÊ¼Ê±¼ä£¬¼ÓÉÏUnixʱ¼äÖµ£¨¼´¹ýÈ¥µÄÃëÊý£©.
ConvertDateTimeInt·½·¨µÄ»ù±¾Ë¼Â·ÊÇͨ¹ý¿Ì¶ÈÊý²î£¬Ôٰѿ̶ÈÊýת»»ÎªÃëÊý£¬µ±È»ÒªËµÃ÷µÄÊÇ£¬ÎÒÕâÀï·µ»ØµÄÊÇdoubleÀàÐÍ£¬ÒâÒåÉϲ¢·ÇÊÇÕæ ......

PHPÖеÄmysql_real_escape_stringº¯Êý

¸ù¾ÝÄãµÄʹÓÃÄ¿µÄÎÒ¾õµÃÕâ¸öº¯ÊýÓÐÁ½·½ÃæµÄÓÃ;£º
·ÀÖ¹SQL Injection¹¥»÷£¬Ò²¾ÍÊÇÄã±ØÐëÑéÖ¤Óû§µÄÊäÈë
²Ù×÷Êý¾ÝµÄʱºò±ÜÃâ²»±ØÒªµÄ×Ö·ûµ¼Ö´íÎó
mysql_real_escape_string() º¯ÊýתÒå SQL Óï¾äÖÐʹÓõÄ×Ö·û´®ÖеÄÌØÊâ×Ö·û¡£
ÏÂÁÐ×Ö·ûÊÜÓ°Ï죺
\x00
\n
\r
\
'
"
\x1a
Èç¹û³É¹¦£¬Ôò¸Ãº¯Êý·µ»Ø±»×ªÒåµÄ×Ö·û´ ......

Geoserver+MYSQLÊý¾ÝÅäÖã¬openlayerÔ¤ÀÀͼ²ãÒì³£

×î½üÕÛÌÚGeoServerÓëMysqlµÄÁ¬½Ó£¬ÊÔÁ˲»ÉÙʱ¼ä£¬³öÏÖÁ˼¸¸öÎÊÌâ
   1 ·¢²¼µÄ»ùÓÚmysqlÊý¾Ý¿âLayer£¬ÔÚÔ¤ÀÀʱʧ°Ü
   Ïà¹Ø°æ±¾ÈçÏ£º
  Gerserver 2.0.1
  Mysql 5.5.1
  mysql-connector-java-5.1.5.jar
  gt-mysql-2.6.0.jar
  ºó³¢ÊÔÌæ»»MysqlÊý¾Ý¿â°æ±¾Îª5.0 ......

mysql Êý¾ÝÀàÐÍvarchar ×ÓжàÉÙ

  ×òÌìÉè¼ÆÊý¾Ý¿â±íµÄʱºò£¬ÒòΪʹÓÃvarchar²úÉúÁËÒìÒ飬½á¹ûÒ»²é·¢ÏÖÎÒÃÇÁ½¸öË­¶¼Ã»´í¡£
   MySQLÊý¾Ý¿âµÄvarcharÀàÐÍÔÚ4.1ÒÔϵİ汾ÖеÄ×î´ó³¤¶ÈÏÞÖÆΪ255£¬ÆäÊý¾Ý·¶Î§¿ÉÒÔÊÇ0~255»ò1~255£¨¸ù¾Ý²»Í¬°æ±¾Êý¾Ý¿âÀ´
¶¨£©¡£
  
ÔÚMySQL5.0ÒÔÉϵİ汾ÖУ¬varcharÊý¾ÝÀàÐ͵ij¤¶ÈÖ§³Öµ½ÁË65535£¬Ò ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ