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

MySQLÐÐËøÉîÈëÑо¿

×öÏîĿʱÓÉÓÚÒµÎñÂß¼­µÄÐèÒª£¬±ØÐë¶ÔÊý¾Ý±íµÄÒ»Ðлò¶àÐмÓÈëÐÐËø£¬¾Ù¸ö×î¼òµ¥µÄÀý×Ó£¬Í¼Êé½èÔÄϵͳ¡£¼ÙÉè id=1 µÄÕâ±¾Êé¿â´æΪ 1 £¬µ«ÊÇÓÐ 2 ¸öÈËͬʱÀ´½èÕâ±¾Ê飬´Ë´¦µÄÂß¼­Îª
view plaincopy to clipboardprint?
Select   restnum  from  book  where  id =1 ;      
-- Èç¹û restnum ´óÓÚ 0 £¬Ö´ÐÐ update  
Update   book  set restnum=restnum-1 where id=1 ;  
Select   restnum  from  book  where  id =1 ;   
-- Èç¹û restnum ´óÓÚ 0 £¬Ö´ÐÐ update
Update   book  set restnum=restnum-1 where id=1 ; 
ÎÊÌâ¾ÍÀ´ÁË£¬µ± 2 ¸öÈËͬʱÀ´½èµÄʱºò£¬ÓпÉÄܵÚÒ»¸öÈËÖ´ÐÐ select Óï¾äµÄʱºò£¬µÚ¶þ¸öÈ˲åÁ˽øÀ´£¬ÔÚµÚÒ»¸öÈËûÀ´µÃ¼°¸üРbook ±íµÄʱºò£¬µÚ¶þ¸öÈ˲鵽Êý¾ÝÁË£¬ÆäʵÊÇÔàÊý¾Ý£¬ÒòΪµÚÒ»¸öÈË»á°Ñ restnum Öµ¼õ 1 £¬Òò´ËµÚ¶þ¸öÈ˱¾À´Ó¦¸ÃÊDz鵽 id=1 µÄÊé restnum Ϊ 0 ÁË£¬Òò´Ë²»»áÖ´ÐÐ update £¬¶ø»á¸æËßËü id=1 µÄÊéûÓпâ´æ ÁË£¬¿ÉÊÇÊý¾Ý¿âÄĶ®ÕâЩ£¬Êý¾Ý¿âÖ»¸ºÔðÖ´ÐÐÒ»ÌõÌõ SQL Óï¾ä£¬Ëü²Å²»¹ÜÖмäÓÐûÓÐÆäËû sql Óï¾ä²å½øÀ´£¬ËüÒ²²»ÖªµÀÒª°ÑÒ»¸ö session µÄ sql Óï¾äÖ´ÐÐÍêÔÙÖ´ÐÐÁíÒ»¸ö session µÄ¡£Òò´Ë»áµ¼Ö²¢·¢µÄʱºò restnum ×îºóµÄ½á¹ûΪ -1 £¬ÏÔÈ»ÕâÊDz»ºÏÀíµÄ£¬ËùÒÔ£¬²Å³öÏÖËøµÄ¸ÅÄ Mysql ʹÓà innodb ÒýÇæ¿ÉÒÔͨ¹ýË÷Òý ¶ÔÊý¾ÝÐмÓËø¡£ÒÔÉϽèÊéµÄÓï¾ä±äΪ£º
    view plaincopy to clipboardprint?
Begin;  
Select   restnum  from  book  where  id =1  for   update ;  
-- ¸ø id=1 µÄÐмÓÉÏÅÅËüËøÇÒ id ÓÐË÷Òý  
Update   book  set restnum=restnum-1 where id=1 ;  
Commit;  
Begin;
Select   restnum  from  book  where  id =1  for   update ;
-- ¸ø id=1 µÄÐмÓÉÏÅÅËüËøÇÒ id ÓÐË÷Òý
Update   book  set restnum=restnum-1 where id=1 ;
Commit;
ÕâÑù£¬µÚ¶þ¸öÈËÖ´Ðе½ select Óï¾äµÄʱºò¾Í»á´¦Óڵȴý״ֱ̬µ½µÚÒ»¸öÈËÖ´ÐÐ commit ¡£´Ó¶ø±£Ö¤Á˵ڶþ¸öÈ˲»»á¶Áµ½µÚÒ»¸öÈËÐÞ¸ÄÇ°µÄÊý¾Ý¡£
ÄÇÕâÑùÊDz»ÊÇÍòÎ


Ïà¹ØÎĵµ£º

MysqlÌæ´ú½â¾ö·½°¸Cassandra

http://incubator.apache.org/cassandra/
http://zh.wikipedia.org/wiki/Cassandra
Apache CassandraÊÇÒ»Ì׿ªÔ´·Ö²¼Ê½Êý¾Ý¿â¹ÜÀíϵͳ¡£Ëü×î³õÓÉFacebook¿ª·¢£¬ÓÃÓÚ´¢´æÌرð´óµÄÊý¾Ý¡£
Ö÷ÒªÌØÐÔ£º
·Ö²¼Ê½
»ùÓÚcolumnµÄ½á¹¹»¯
¸ßÉìÕ¹ÐÔ
CassandraµÄÖ÷ÒªÌصã¾ÍÊÇËü²»ÊÇÒ»¸öÊý¾Ý¿â£¬¶øÊÇÓÉÒ»¶ÑÊý¾Ý¿â½Úµã¹²Í¬¹¹³ÉµÄÒ» ......

MySQL°²×°

MysqlµÄ°²×°Îļþ¿ÉÒÔÖ±½Óµ½ http://www.mysql.com ÏÂÔØ£¬»ñµÃfor win32µÄ.zip°ü£¬½¨ÒéÑ¡Ôñ4.0.20d°æ±¾¡£ÕâÀï²»Ïêϸ˵Ã÷¡£
¡¡¡¡ÏÂÔØ»ñµÃMysqlµÄfor win32°²×°°üºó£¬ÓÃwinzip½âѹËõ£¬Ö±½ÓÔËÐÐsetup.exe£¬ÐèҪעÒâµÄÊÇÑ¡ÔñÒ»¸ö°²×°Â·¾¶£¬µ±È»£¬°²×°Â·¾¶¿ÉÒÔÈÎÒ⣬½¨ÒéÑ¡ÔñC:\MySQLĿ¼¡£°²×°Íê³ÉºóMySQLÒ²¾ÍÍê³ÉÁË¡£Ä¬ÈϵÄÓû ......

ʵÏÖJavaÁ¬½Ómysql£¨Ô´Â룩£¡

JavaÁ¬½ÓmysqlÊý¾Ý¿â£¬´úÂë¾­¹ýÔËÐÐ׼ȷÎÞÎó¡£
ÏÂÃæΪʵÀý---->
ÓÃÊý¾Ý¿â²Ù×ݹ¤¾ß£¨Àý£ºSQLyogEnt£©²Ù×Ýmysql½¨±í£¬»òdosϽ¨£¬ÈçÏ£º
Êý¾Ý¿âÃû£ºscutcs
±íÃû£ºstudent
±íÄÚÈÝ£º
sno  char[7]  NO NULL Primary Key;
sname  varchar[8]  NO NULL;
sex  char[2]  NO NULL; ......

MySQLËøÓ÷¨½éÉÜ

http://book.51cto.com/art/200803/68118.htm
ÕªÒª£º¡¶ÉîÈëdz³öMySQL——Êý¾Ý¿â¿ª·¢¡¢ÓÅ»¯Óë¹ÜÀíά»¤¡·´ÓÊý¾Ý¿âµÄ»ù´¡¡¢¿ª·¢¡¢ÓÅ»¯¡¢¹ÜÀí4·½Ãæ¶ÔMySQL½øÐÐÁËÏêϸµÄ½éÉÜ£¬ÆäÖÐÿһ²¿·Ö¶¼¶ÀÁ¢³Éƪ£¬Ã¿Ò»ÆªÓÖ°üÀ¨¶à¸öÕ½ڡ£±¾ÊéÃæÏòʵÓã¬ÄÚÈݸ²¸Ç¹ã·º£¬½²½âÓÉdzÈëÉÊʺÏÓÚ¸÷¸ö²ã´ÎµÄ¶ÁÕß¡£
µÚ20ÕÂ ËøÎÊÌâ
ËøÊÇ ......

TwitterÓû§±©Ôö20±¶ ÓûÆúÓÃMySQLÊý¾Ý¿â

     Twitter¹«Ë¾Ò»Î»Ãû½ÐRyan KingµÄ¹¤³ÌʦÈÕÇ°Ïò²©¿ÍMyNoSQL͸¶£¬¹«Ë¾¼Æ»®´ÓMySQLǨÒƵ½CassandraÊý¾Ý¿â£¬ÒòΪºóÕß¾ßÓиü´óµÄµ¯ÐÔ¡¢¿ÉÀ©Õ¹ÐԺʹóÁ¿µÄÉçÇøÍøÂ翪Դ¿ª·¢ÈËÔ±¡£
ÎÒÃÇÓдóÁ¿µÄÊý¾Ý£¬ÔÚÊý¾Ý¾Þ´ó£¬Ôö³¤ÂÊÕýÔÚ¼ÓËÙµÄÇé¿öÏ£¬ÎÒÃÇÐèÒªÒ»¸öϵͳ£¬Ëü¿ÉÒÔ¸üΪ×Ô¶¯»¯£¬²¢¸ß¶È¿É¿¿¡¢¿ÉÓá£Ryan K ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ