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

MySQLÓÅ»¯

MySQLÓÅ»¯
ͬʱÔÚÏß·ÃÎÊÁ¿¼ÌÐøÔö´ó£¬¶ÔÓÚ1GÄÚ´æµÄ·þÎñÆ÷Ã÷ÏԸоõµ½³ÔÁ¦ÑÏÖØʱÉõÖÁÿÌ춼»áËÀ»ú£¬»òÕßʱ²»Ê±µÄ·þÎñÆ÷¿¨Ò»Ï£¬Õâ¸öÎÊÌâÔø¾­À§ÈÅÁËÎÒ°ë¸ö¶àÔ¡£MySQLʹÓÃÊǺܾßÉìËõÐÔµÄËã·¨£¬Òò´ËÄãͨ³£ÄÜÓúÜÉÙµÄÄÚ´æÔËÐлò¸øMySQL¸ü¶àµÄ±»´æÒԵõ½¸üºÃµÄÐÔÄÜ¡£
°²×°ºÃmysqlºó£¬ÅäÖÆÎļþÓ¦¸ÃÔÚ/usr/local/mysql/share/mysqlĿ¼ÖУ¬ÅäÖÆÎļþÓм¸¸ö£¬ÓÐmy- huge.cnf my-medium.cnf my-large.cnf my-small.cnf£¬²»Í¬µÄÁ÷Á¿µÄÍøÕ¾ºÍ²»Í¬ÅäÖƵķþÎñÆ÷»·¾³£¬µ±È»ÐèÒªÓв»Í¬µÄÅäÖÆÎļþÁË¡£Ò»°ãµÄÇé¿öÏ£¬my-medium.cnfÕâ¸öÅäÖÆÎļþ¾ÍÄÜÂú×ãÎÒÃǵĴó¶àÐèÒª£»Ò»°ãÎÒÃÇ»á°ÑÅäÖÃÎļþ¿½±´µ½/etc/my.cnf Ö»ÐèÒªÐÞ¸ÄÕâ¸öÅäÖÃÎļþ¾Í¿ÉÒÔÁË£¬Ê¹ÓÃmysqladmin variables extended-status –u root –p ¿ÉÒÔ¿´µ½Ä¿Ç°µÄ²ÎÊý£¬ÓУ³¸öÅäÖòÎÊýÊÇ×îÖØÒªµÄ£¬¼´key_buffer_size¡¢query_cache_size¡¢table_cache¡£
key_buffer_sizeÖ»¶ÔMyISAM±íÆð×÷Óã¬key_buffer_sizeÖ¸¶¨Ë÷Òý»º³åÇøµÄ´óС£¬Ëü¾ö¶¨Ë÷Òý´¦ÀíµÄËٶȣ¬ÓÈÆäÊÇË÷Òý¶ÁµÄËٶȡ£Ò»°ãÎÒÃÇÉèΪ16M£¬Êµ¼ÊÉÏÉÔ΢´óÒ»µãµÄÕ¾µã¡¡Õâ¸öÊý×ÖÊÇÔ¶Ô¶²»¹»µÄ£¬Í¨¹ý¼ì²é״ֵ̬Key_read_requestsºÍKey_reads£¬¿ÉÒÔÖªµÀkey_buffer_sizeÉèÖÃÊÇ·ñºÏÀí¡£±ÈÀýkey_reads / key_read_requestsÓ¦¸Ã¾¡¿ÉÄܵĵͣ¬ÖÁÉÙÊÇ1:100£¬1:1000¸üºÃ(ÉÏÊö״ֵ̬¿ÉÒÔʹÓÃSHOW STATUS LIKE 'key_read%'»ñµÃ)¡£ »òÕßÈç¹ûÄã×°ÁËphpmyadmin ¿ÉÒÔͨ¹ý·þÎñÆ÷ÔËÐÐ״̬¿´µ½£¬±ÊÕßÍƼöÓÃphpmyadmin¹ÜÀímysql£¬ÒÔϵÄ״ֵ̬¶¼ÊDZ¾ÈËͨ¹ýphpmyadmin»ñµÃµÄʵÀý·ÖÎö:
key_buffer_size – 128M
Õâ¸ö·þÎñÆ÷ÒѾ­ÔËÐÐÁË20Ì죬²éѯ³öÀ´µÄÖµ£º
key_read_requests – 650759289
key_reads - 79112 ±ÈÀý½Ó½ü1:8000 ½¡¿µ×´¿ö·Ç³£ºÃ
ÁíÍâÒ»¸ö¹À¼Ækey_buffer_sizeµÄ°ì·¨£º°ÑÄãÍøÕ¾Êý¾Ý¿âµÄÿ¸ö±íµÄË÷ÒýËùÕ¼¿Õ¼ä´óС¼ÓÆðÀ´¿´¿´¡£ÒÔ´Ë·þÎñÆ÷ΪÀý£¬±È½Ï´óµÄ¼¸¸ö±íË÷Òý¼ÓÆðÀ´´ó¸Å125M£¬Õâ¸öÊý×Ö»áËæ×űí±ä´ó¶ø±ä´ó¡£
´Ó4.0.1¿ªÊ¼£¬MySQLÌṩÁ˲éѯ»º³å»úÖÆ¡£Ê¹Óòéѯ»º³å£¬MySQL½«SELECTÓï¾äºÍ²éѯ½á¹û´æ·ÅÔÚ»º³åÇøÖУ¬½ñºó¶ÔÓÚͬÑùµÄSELECTÓï¾ä(Çø·Ö´óСд)£¬½«Ö±½Ó´Ó»º³åÇøÖжÁÈ¡½á¹û¡£¸ù¾ÝMySQLÓû§ÊֲᣬʹÓòéѯ»º³å×î¶à¿ÉÒÔ´ïµ½238%µÄЧÂÊ¡£
ͨ¹ýSHOW STATUS LIKE 'Qcache%'²éѯÒÔϼ¸¸ö״ֵ̬¿ÉÒÔÖªµÀquery_cache_sizeÉèÖõÃÊÇ·ñºÏÀí£º
Qcache inserts
Qcache hits
Qcache lowmem prunes
Qcache free blocks
Qcache total blocks
Èç¹ûQcac


Ïà¹ØÎĵµ£º

mysql ½«±íÖÐÊý¾Ýµ¼³ö £¨linux£©

½ñÌìÓöµ½Òªµ¼³öÊý¾Ý¿âÖбíµÄÊý¾Ý¡£ÏÂÃæÕâ¸ö¾Í¿ÉÒԸ㶨¡£¡£
#µ¼³öÖ¸¶¨µÄ±í #µ¼³öÃüÁî -uÓû§Ãû -pÃÜÂë -hÖ÷»úIPµØÖ· Êý¾Ý¿âÃû ±íÃû1 ±íÃû2 > µ¼³öÎļþ.sql
mysqldump -uroot -proot -h192.168.0.88 ok_db oktable1 oktable2 > ok_db.sql
ÁíÍâÔÚ¸ü¸ÄmysqlÃÜÂëʱºò£¬ÍøÉÏÓÐЩÃüÁî²»¶Ô£º
ÎÒÓÃÈçÏ£ºset password=pas ......

MySQL ÄÚ´æÄ£ÐÍ hust ei

¶ÔÓÚÈκÎÒ»¸öÊý¾Ý¿â¹ÜÀíϵͳÀ´Ëµ£¬ÄÚ´æµÄ·ÖÅäʹÓþø¶Ô¿ÉÒÔËãµÄÉÏÊÇÆäºËÐÄÖ®Ò»ÁË£¬ËùÒԺܶàÏ£Íû¸üΪÉîÈëÁ˽âijÊý¾Ý¿â¹ÜÀíϵͳµÄÈË£¬¶¼»áÏ£ÍûÒ»¿ú¾¿¾¹£¬ÎÒÒ²²»ÀýÍâ¡£
´ÓÄÚ´æµÄʹÓ÷½Ê½MySQL Êý¾Ý¿âµÄÄÚ´æʹÓÃÖ÷Òª·ÖΪÒÔÏÂÁ½Àà
* Ï̶߳ÀÏíÄÚ´æ
* È«¾Ö¹²ÏíÄÚ´æ
½ñÌìÕâƪÎÄÕÂÔÝʱÏÈ·ÖÎö MySQL ÖÐÖ÷ÒªµÄ “Ï̶߳ÀÏíÄ ......

MySQL Ë÷Òý¸ÅÊö hust ei

±¾ÎĽéÉÜÁËÊý¾Ý¿âË÷Òý£¬¼°ÆäÓÅ¡¢È±µã¡£Õë¶ÔMySQLË÷ÒýµÄÌص㡢ӦÓýøÐÐÁËÏêϸµÄÃèÊö¡£·ÖÎöÁËÈçºÎ±ÜÃâMySQLÎÞ·¨Ê¹Óã¬ÈçºÎʹÓÃEXPLAIN·ÖÎö²éѯÓï¾ä£¬ÈçºÎÓÅ»¯MySQLË÷ÒýµÄÓ¦Óᣱ¾ÎÄÕª×Ô¡¶MySQL 5ȨÍþÖ¸ÄÏ¡·(3rd)µÄ8.9½Ú¡£(2007.07.05×îºó¸üÐÂ)
    Ë÷ÒýÊÇÒ»ÖÖÌØÊâµÄÎļþ(InnoDBÊý¾Ý±íÉϵÄË÷ÒýÊDZí¿Õ¼äµÄÒ»¸ö× ......

¿ìËÙµ¼³öµ¼ÈëmysqlÃüÁî


mysqldump -u root -p -e --max_allowed_packet=1048576 --net_buffer_length=16384 msiptv>c:\thedump.sql
ÎÊÌ⣺ÔÚʹÓÃmysql¹ý³ÌÖб¸·ÝÊý¾Ý£¬Ò»°ã¶¼ÊDZ»·Ö³ÉsqlÓï¾äÎı¾£¬µ«mysqldumpÃüÁîĬÈÏÊǷdz£»úеµØ´¦ÀíÓï¾äµÄ×éÖ¯¡£µ¼ÖÂÖØе¼ÈëµÄʱºòЧÂÊÌ«µÍ¡£±ÈÈç10ÍòÌõÊý¾Ý¾ÍÒªÖ´ÐÐ10Íò´ÎµÄsqlÓï¾ä£¬ºÄʱ̫¶à¡£
Ô­Àí£º ......

Ò»¶Î×Ô¶¯±¸·ÝµÄMYSQL±¸·ÝµÄ½Å±¾

     ×î½ü¹«Ë¾×¼±¸Ê¹ÓÃÏîÄ¿¹ÜÀíµÄÍøÕ¾DotProject£¬¹«Ë¾ËäÈ»²»´ó£¬µ«ÊÇÇ£Éæµ½µÄÒµÎñÒ²ÊǺܸ´Ôӵģ¬ËùÒÔÐèÒª¶¨Ê±È¥±£´æÊý¾Ý¿âµÄÐÅÏ¢ÒÔ·ÀÖ¹Êý¾Ý¿â±ÀÀ£»òÕßÆäËûµÄÔ­ÒòÔì³ÉµÄÊý¾ÝËðʧ£¬ÕâÑù¾ÍÐèÒª½øÐÐÊý¾Ý¿âµÄ±¸·Ý¡£
     DotProjectʹÓõÄÊÇMysqlÊý¾Ý¿â£¬±¸·ÝMysqlÊý¾Ý¿âµÄÒ»¸ö±È½ÏºÃµÄ·½·¨¾ÍÊÇ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ