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

ÈÃmemcachedºÍmysql¸üºÃµÄ¹¤×÷

¡¡Õâ´ÎÊÇFotolog
µÄ¾­Ñ飬´«ËµÖбÈFlickr¸ü´óµÄÍøÕ¾
£¬FotologÔÚ21̨·þÎñ
Æ÷Éϲ¿ÊðÁË51¸ömemcachedʵÀý£¬×ܼÆÓÐ254G»º´æ¿Õ¼ä
¿ÉÓ㬻º´æÁ˶à´ï175GµÄÄÚÈÝ£¬Õâ¸öÊýÁ¿±ÈºÜ¶àÍøÕ¾µÄÊý¾Ý¿â¶¼Òª´óµÄ¶à£¬Ô­ÎÄÊÇA Bunch of Great Strategies for Using Memcached and MySQL Better Together
£¬ÎÒÕâÀﻹÊÇÑ¡ÔñÐԵķ­ÒëÒÔ¼°°´ÕÕÎÒµÄÀí½â²¹³ä£¬¸ÐлTodd Hoff
£¬×ÜÄܸøÎÒÃÇ
һЩѧϰ
µÄ°¸Àý£¬´ÓÕâÀïÒ²ÄÜ¿´³ö¹úÍâ¼¼Êõ
µÄ¿ª·Å̬¶È£¬²»ËÆÎÒÃÇ£¬Æäʵ¾ÍÄÇôµãС¾Å¾Å»¹²Ø×ÅÒ´×Å£¬ºÃÁË£¬½øÈëÕýÌâ¡£
Ò»¡¢¹ØÓÚmemcached
¡¡¡¡»¹²»ÖªµÀÕâ¸ö£¿ÄÇÄãÈ¥ÃæÊÔµÄʱºòÒª³Ô¿÷ÁË£¬¸Ï½ôÈ¥¹Ù·½ÍøÕ¾¿´Ò»ÏÂhttp://www.danga.com/memcached/
£¬ÁíÍâgoogleÒ»ÏÂÓ÷¨£¬Ó²ÅÌ×ÜÊÇÌ«Âý£¬°ÑÊý¾Ý´æÔÚÄÚ´æÀïÃæ°É£¬Èç¹ûÄãÖ»ÓÐһ̨·þÎñÆ÷£¬ÍƼöÓÃÒ»ÏÂAPC
(FacebookÔÚÓÃ)»òÕßeaccelerator
»òÕßXcache
(¹úÈË¿ª·¢µÄ)£¬ÕâЩ²úÆ·µ¥»úЧ¹û¸üºÃ£¬Èç¹ûÄãÐèÒª
·Ö²¼Ê½µÄ»º´æ·½°¸£¬ÄÇôÓÃmemcached°É¡£
¶þ¡¢memcachedÈçºÎÓëmysql²¢¼ç×÷Õ½£¿
ͨ¹ýÊý¾Ý¿â·ÖƬÀ´½â¾öÊý¾Ý¿âдÀ©Õ¹µÄÎÊÌâ°ÑÊý¾Ý¿â·ÖƬ£¬²¿Êðµ½²»Í¬µÄ·þÎñÆ÷ÉÏ£¬ÃâµÃÖ»ÓÐÒ»¸öÖ÷·þÎñÆ÷£¬Ð´²Ù×÷³ÉΪƿ¾±ÒÔ¼°¿ÉÄÜÓеēµ¥µã¹ÊÕÏ”£¬Ò»°ãµÄÊý¾Ý¿â·ÖƬÖ÷ÒªÊÇ°´ÕÕÒµÎñÀ´·Ö£¬¾¡¿ÉÄܵIJð·ÖÒµÎñ£¬²»Ïà¸ÉµÄ¶¼¶ÀÁ¢ÆðÀ´
×ö³É·þÎñÒ²ºÃ
Ç°¶ËmysqlºÍÒ»¶Ñmemcached·þÎñÆ÷À´Ó¦¸¶¶ÁµÄÎÊÌâÓ¦ÓóÌÐòÊ×ÏÈ´ÓmemcachedÖлñÈ¡Êý¾Ý£¬»ñÈ¡²»µ½ÔÙ´ÓÊý¾Ý¿âÖлñµÃ²¢±£´æ
ÔÚmemcachedÖУ¬ÒÔÇ°¿´¹ýһƪÎÄÕÂ˵ºÃµÄÓ¦ÓÃ95£¥µÄÊý¾Ý´ÓmemcacheµÄÖлñµÃ£¬3£¥µÄÊý¾Ý´ÓmysqlµÄquery cacheÖлñµÃ£¬Ê£ÏÂ2£¥²ÅÈ¥²é±í£¬¶Ô±ÈÒ»ÏÂÄãµÄÓ¦Ó㬲î¾àÓжàÔ¶£¿
ͨ¹ýmysql¸´ÖÆ£¨master-slave£©À´½â¾ö¶ÁµÄÎÊÌâ
Ê×ÏÈmysqlÊý¾Ý¿âͨ¹ýmaster-slave¶Áд·ÖÀ룬¶à¸öslaveÀ´Ó¦¶ÔÓ¦ÓóÌÐò¶ÁµÄ²Ù×÷¡£
Èý¡¢ÎªÊ²Ã´²»ÓÃmysqlµÄquery cache£¿
¡¡¡¡ÎÒÃǶ¼ÖªµÀmysqlÓиöquery cache£¬¿ÉÒÔ»º´æÉϴβéѯµÄ½á¹û£¬¿Éʵ¼ÊÉÏ°ï²»ÉÏÌ«¶àµÄ棬ÏÂÃæÊÇmysql quety cacheµÄ²»×㣺
Ö»ÄÜÓÐÒ»¸öʵÀý
Òâζ×ÅÄãÄÜ´æ´¢ÄÚÈݵÄÉÏÏÞ¾ÍÊÇÄã·þÎñÆ÷µÄ¿ÉÓÃÄڴ棬һ̨·þÎñÆ÷ÄÜÓжàÉÙÄڴ棿ÄãÓÖÄÜ´æ¶àÉÙÄØ£¿
Ö»ÒªÓÐд²Ù×÷£¬mysqlµÄquery cache¾ÍʧЧ
Ö»ÒªÊý¾Ý¿âÄÚÈÝÉÔÓиıä
£¬ÄÇŸıäµÄÊÇÆäËûÐУ¬mysqlµÄquery cacheÒ²»áʧЧ
mysqlµÄquery cacheÖ»ÄÜ»º´æÊý¾Ý¿âÊý¾ÝÐÐ
Òâζ×ÅÆäËûÄÚÈݶ¼²»ÐУ¬±ÈÈçÊý×飬±ÈÈç¶ÔÏ󣬶ømemcachedÀíÂÛÉÏ¿ÉÒÔ»º´æÈκÎÄÚÈÝ£¬ÉõÖÁÎļþ^_^
ËÄ¡¢FotologµÄ»º´æ¼¼Êõ
·ÇÈ·¶¨ÐÔ»º´æ


Ïà¹ØÎĵµ£º

MySQL³£¼û×Ö·û´®º¯Êýѧϰ

1.reverse(str)º¯Êý: ·µ»Øµßµ¹×Ö·û˳ÐòµÄ×Ö·û´®str, ¸Ãº¯Êý¶Ô¶à×Ö½Ú¿É¿¿µÄ.
mysql> select * from user;
+----+------------------+
| id | name             |
+----+------------------+
|  1 | test      &nbs ......

mysqlÓÅ»¯×ܽá

Èç¹û´ó¼ÒÓÐÒìÒ飬¿ÉÒÔÔÚºóÃæ²¹³ä¡£ÎÒ»áËæʱ¸üеġ£
ÏÖÔÚ´ó¸ÅÁгöÈçÏÂ:(Íû¸÷λ²¹³ä)
1.Êý¾Ý¿âµÄÉè¼Æ
¾¡Á¿°ÑÊý¾Ý¿âÉè¼ÆµÄ¸üСµÄÕ¼´ÅÅÌ¿Õ¼ä.
1).¾¡¿ÉÄÜʹÓøüСµÄÕûÊýÀàÐÍ.(mediumint¾Í±Èint¸üºÏÊÊ).
2).¾¡¿ÉÄܵĶ¨Òå×Ö¶ÎΪnot null,³ý·ÇÕâ¸ö×Ö¶ÎÐèÒªnull.£¨Õâ¸ö¹æÔòÖ»ÊʺÏ×Ö¶ÎΪKEYµÄÇéÐΣ©
3).Èç¹ûûÓÐÓõ½±ä³¤×Ö¶ÎµÄ ......

MySQL 5.1 °²×°ÅäÖÃͼ½â


Ò»¡¢MySQL5.1°²×°
       ´ò¿ªÏÂÔصݲװÎļþ£¬³öÏÖÈçϽçÃ棺
 
mysql°²×°Ïòµ¼Æô¶¯£¬µã»÷“next”¼ÌÐø
 
        Ñ¡Ôñ°²×°ÀàÐÍ£¬ÓГTypical£¨Ä¬ÈÏ£©”¡¢“Complete£¨ÍêÈ«£©”¡¢“Custom£¨Óû§×Ô¶ ......

mysql ûÓÐdataĿ¼µÄ½â¾ö·½°¸

¿ÉÒԲ鿴mysqlÎļþĿ¼my.iniÎļþ£¬¿ÉÒÔÕÒµ½ÀàËÆÓÚ
datadir="D:/beeagle/Program Files/MySQL/MySQL Server 5.0/Data/"µÄ×Ö¶Î
¸Ã·¾¶Îªmysql dataĿ¼
ĬÈÏÔÚ£º"C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\Data\"
×¢Ò⣺Application DataÎļþ¼ÐÊÇÒþ²ØµÄ£¡£¡£¡
¿ÉÒÔÐÞ¸ÄÉÏÊöÅäÖ㬠......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ