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

Mysql Innodb ÒýÇæÓÅ»¯(


²ÎÊýƪ
×÷/ÒëÕߣºÎâ±þÎý£¬À´Ô´£ºhttp://imysql.cn¡¡£¦¡¡http://imysql.cn/blog/3208¡¡×ªÔØÇë×¢Ã÷×÷/ÒëÕߺͳö´¦£¬²¢ÇÒ²»ÄÜÓÃÓÚÉÌÒµÓÃ;£¬Î¥Õ߱ؾ¿¡£
 
½éÉÜ£º
¡¡¡¡InnoDB¸øMySQLÌṩÁ˾ßÓÐÌá½»£¬»Ø¹öºÍ±ÀÀ£»Ö¸´ÄÜÁ¦µÄÊÂÎñ°²È«£¨ACID¼æÈÝ£©´æ´¢ÒýÇæ¡£InnoDBËø¶¨ÔÚÐм¶²¢ÇÒÒ²ÔÚSELECTÓï¾äÌṩһ¸öOracle·ç¸ñÒ»ÖµķÇËø¶¨¶Á¡£ÕâЩÌØÉ«Ôö¼ÓÁ˶àÓû§²¿ÊðºÍÐÔÄÜ¡£Ã»ÓÐÔÚInnoDBÖÐÀ©´óËø¶¨µÄÐèÒª£¬ÒòΪÔÚInnoDBÖÐÐм¶Ëø¶¨ÊʺϷdz£Ð¡µÄ¿Õ¼ä¡£InnoDBÒ²Ö§³ÖFOREIGN KEYÇ¿ÖÆ¡£ÔÚSQL²éѯÖУ¬Äã¿ÉÒÔ×ÔÓɵؽ«InnoDBÀàÐ͵ıíÓëÆäËüMySQLµÄ±íµÄÀàÐÍ»ìºÏÆðÀ´£¬ÉõÖÁÔÚͬһ¸ö²éѯÖÐÒ²¿ÉÒÔ»ìºÏ¡£
¡¡Innodb µÄ´´Ê¼ÈË£ºHeikki Tuuri
¡¡Heikki TuuriÔڣɣî£î£ï£ä£âµÄ£Â£õ£çÉçÇøÀïÒ²ÊǺܻîÔ¾µÄ£¬Èç¹ûÓöµ½£Â£õ£çÒ²¿ÉÒÔÖ±½ÓÌáµ½ÉçÇø£¬µÃµ½×÷ÕߵĽâ´ð¡£
ΪʲôҪѧϰ£É£î£î£ï£ä£âµÄµ÷ÓÅ£º
¡¡¡¡Ä¿Ç°À´Ëµ£ºInnoDBÊÇΪMysql´¦Àí¾Þ´óÊý¾ÝÁ¿Ê±µÄ×î´óÐÔÄÜÉè¼Æ¡£ËüµÄCPUЧÂÊ¿ÉÄÜÊÇÈκÎÆäËü»ùÓÚ´ÅÅ̵ĹØϵÊý¾Ý¿âÒýÇæËù²»ÄÜÆ¥µÐµÄ¡£ÔÚÊý¾ÝÁ¿´óµÄÍøÕ¾»òÊÇÓ¦ÓÃÖÐInnodbÊDZ¶ÊÜÇàíùµÄ¡£
¡¡¡¡ÁíÒ»·½Ã棬ÔÚÊý¾Ý¿âµÄ¸´ÖƲÙ×÷ÖÐInnodbÒ²ÊÇÄܱ£Ö¤masterºÍslaveÊý¾ÝÒ»ÖÂÓÐÒ»¶¨µÄ×÷Óá£
²ÎÊýµ÷ÓÅÄÚÈÝ£º
¡¡¡¡1. ÄÚ´æÀûÓ÷½Ãæ
¡¡¡¡2. ÈÕÖµ¿ØÖÆ·½Ãæ
¡¡¡¡3.¡¡ÎļþIO·ÖÅ䣬¿Õ¼äÕ¼Ó÷½Ãæ
¡¡¡¡4. ÆäËüÏà¹Ø²ÎÊý
£±.ÄÚ´æÀûÓ÷½Ã棺
Ê×ÏȽéÉÜÒ»¸öInnodb×îÖØÒªµÄ²ÎÊý£º
innodb_buffer_pool_size
¡¡¡¡Õâ¸ö²ÎÊýºÍMyISAMµÄkey_buffer_sizeÓÐÏàËÆÖ®´¦£¬µ«Ò²ÊÇÓвî±ðµÄ¡£Õâ¸ö²ÎÊýÖ÷Òª»º´æinnodb±íµÄË÷Òý£¬Êý¾Ý£¬²åÈëÊý¾ÝʱµÄ»º³å¡£ÎªInnodb¼ÓËÙÓÅ»¯Ê×Òª²ÎÊý¡£
¡¡¡¡¸Ã²ÎÊý·ÖÅäÄÚ´æµÄÔ­Ôò£ºÕâ¸ö²ÎÊýĬÈÏ·ÖÅäÖ»ÓÐ8M£¬¿ÉÒÔ˵ÊǷdz£Ð¡µÄÒ»¸öÖµ¡£Èç¹ûÊÇÒ»¸öרÓãģ·þÎñÆ÷£¬ÄÇôËû¿ÉÒÔÕ¼µ½ÄÚ´æµÄ70%-80%¡£Õâ¸ö²ÎÊý²»Äܶ¯Ì¬¸ü¸Ä£¬ËùÒÔ·ÖÅäÐè¶à¿¼ÂÇ¡£·ÖÅä¹ý´ó£¬»áʹSwapÕ¼Óùý¶à£¬ÖÂʹMysqlµÄ²éѯÌØÂý¡£Èç¹ûÄãµÄÊý¾Ý±È½ÏС£¬ÄÇô¿É·ÖÅäÊÇÄãµÄÊý¾Ý´óС£«£±£°£¥×óÓÒ×öΪÕâ¸ö²ÎÊýµÄÖµ¡£ÀýÈ磺Êý¾Ý´óСΪ£µ£°£Í,ÄÇô¸øÕâ¸öÖµ·ÖÅäinnodb_buffer_pool_size£½£¶£´£Í
ÉèÖ÷½·¨£º
innodb_buffer_pool_size=4G
Õâ¸ö²ÎÊý·ÖÅäÖµµÄʹÓÃÇé¿ö¿ÉÒÔ¸ù¾Ýshow innodb status\G;ÖеÄ
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 4668764894;
ȥȷÈÏʹÓÃÇé¿ö¡£
µÚ¶þ¸ö£º
innodb_additional_mem_pool£º
×÷ÓãºÓÃÀ´´æ·ÅInnodbµÄÄÚ²¿Ä¿Â¼
Õâ¸öÖµ²»Ó÷ÖÅ


Ïà¹ØÎĵµ£º

MYSQL Êֲ᡾ժ¡¿

 20 MySQL¿Í»§¹¤¾ßºÍAPI
20.1 MySQL C API
C API´úÂëÊÇËæMySQL·Ö·¢µÄ£¬Ëü±»°üº¬ÔÚmysqlclient¿âÇÒÔÊÐíC³ÌÐò´æÈ¡Ò»¸öÊý¾Ý¿â¡£
ÔÚ MySQLÔ´´úÂë·Ö·¢Öеĺܶà¿Í»§ÊÇÓÃC±àдµÄ¡£Èç¹ûÄãÕýÔÚÑ°ÕÒÑÝʾÔõÑùʹÓÃC APIµÄÀý×Ó£¬¿´Ò»ÏÂÕâЩ¿Í»§³ÌÐò¡£
´ó¶àÊýÆäËû¿Í»§ API(³ýÁËJavaµÄËùÓÐ)¶¼Ê¹ÓÃmysqlclient¿âÓëMySQL·þÎñÆ÷ͨÐÅ ......

mysql Æ𶯴íÎó½â¾ö°ì·¨

mysql Æ𶯴íÎó½â¾ö°ì·¨- -
                                      
Access denied for user ''@'localhost' to d ......

MySQLתÒå

MySQLʶ±ðÏÂÁÐתÒå×Ö·û£º    
   
  \0    
  Ò»¸öASCII   0   (NUL)×Ö·û¡£    
  \n    
  Ò»¸öÐÂÐзû¡£    
  \t   &nb ......

mysql alter Óï¾äÓ÷¨,Ìí¼Ó¡¢Ð޸ġ¢É¾³ý×ֶεÈ

mysql alter Óï¾äÓ÷¨,Ìí¼Ó¡¢Ð޸ġ¢É¾³ý×ֶεÈ
//Ö÷¼ü549830479
alter table tabelname add new_field_id int(5) unsigned default 0 not null auto_increment ,add primary key (new_field_id);
//Ôö¼ÓÒ»¸öÐÂÁÐ549830479
alter table t2 add d timestamp;
alter table infos add ex tinyint not null default ......

MySQL µ¼Èëµ¼³öÃüÁî

      ×î½ü±ðÈËÔÚ¸øÎÒ sql Îļþʱ¼òµ¥µÄÌáÁËÏ µ¼Èë/µ¼³ö ÃüÁÔÚ´Ë»ù´¡ÉÏѧϰÁËÏ£¬×ܽᵽ myhere¡£
    ¹æ¶¨£º
Óû§Ãû£ºdb_user
Õʺţº db_pass
Êý¾Ý¿â£º db_name
񡜧 table_name_1, table_name_2
    ˵Ã÷£º  һЩ²Ù×÷ÐèÒªÓÐÊʵ±µÄȨÏÞ¡£
1. ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ