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

mysqlά»¤³£ÓÃÃüÁî

Analyze Table
MySQL µÄOptimizer£¨ÓÅ»¯Ôª¼þ£©ÔÚÓÅ»¯SQLÓï¾äʱ£¬Ê×ÏÈÐèÒªÊÕ¼¯Ò»Ð©Ïà¹ØÐÅÏ¢£¬ÆäÖоͰüÀ¨±íµÄcardinality£¨¿ÉÒÔ·­ÒëΪ“É¢Áг̶Ȕ£©£¬Ëü±íʾij¸öË÷Òý¶ÔÓ¦µÄÁаüº¬¶àÉÙ¸ö²»Í¬µÄÖµ——Èç¹ûcardinality´ó´óÉÙÓÚÊý¾ÝµÄʵ¼ÊÉ¢Áг̶ȣ¬ÄÇôË÷Òý¾Í»ù±¾Ê§Ð§ÁË¡£
ÎÒÃÇ¿ÉÒÔʹÓÃSHOW INDEXÓï¾äÀ´²é¿´Ë÷ÒýµÄÉ¢Áг̶ȣº
SHOW INDEX from PLAYERS;
TABLE   KEY_NAME COLUMN_NAME CARDINALITY
------- -------- ----------- -----------
PLAYERS PRIMARY  PLAYERNO             14
ÒòΪ´ËʱPLAYER±íÖв»Í¬µÄPLAYERNOÊýÁ¿Ô¶Ô¶¶àÓÚ14£¬Ë÷Òý»ù±¾Ê§Ð§¡£
ÏÂÃæÎÒÃÇͨ¹ýAnalyze TableÓï¾äÀ´ÐÞ¸´Ë÷Òý£º
ANALYZE TABLE PLAYERS;
SHOW INDEX from PLAYERS;
½á¹ûÊÇ£º
TABLE   KEY_NAME COLUMN_NAME CARDINALITY
------- -------- ----------- -----------
PLAYERS PRIMARY  PLAYERNO           1000
´ËʱË÷ÒýÒѾ­ÐÞ¸´£¬²éѯЧÂÊ´ó´óÌá¸ß¡£
ÐèҪעÒâµÄÊÇ£¬Èç¹û¿ªÆôÁËbinlog£¬ÄÇôAnalyze TableµÄ½á¹ûÒ²»áдÈëbinlog£¬ÎÒÃÇ¿ÉÒÔÔÚanalyzeºÍtableÖ®¼äÌí¼Ó¹Ø¼ü×ÖlocalÈ¡ÏûдÈë¡£
Checksum Table
Êý¾ÝÔÚ´«Êäʱ£¬¿ÉÄܻᷢÉú±ä»¯£¬Ò²ÓпÉÄÜÒòΪÆäËüÔ­ÒòË𻵣¬ÎªÁ˱£Ö¤Êý¾ÝµÄÒ»Ö£¬ÎÒÃÇ¿ÉÒÔ¼ÆËãchecksum£¨Ð£ÑéÖµ£©¡£
ʹÓÃMyISAMÒýÇæµÄ±í»á°Ñchecksum´æ´¢ÆðÀ´£¬³ÆΪlive checksum£¬µ±Êý¾Ý·¢Éú±ä»¯Ê±£¬checksum»áÏàÓ¦±ä»¯¡£
ÔÚÖ´ÐÐChecksum Tableʱ£¬¿ÉÒÔÔÚ×îºóÖ¸¶¨Ñ¡Ïîqiuck»òÊÇextended£»qiuck±íʾ·µ»Ø´æ´¢µÄchecksumÖµ£¬¶øextended»áÖØмÆËãchecksum£¬Èç¹ûûÓÐÖ¸¶¨Ñ¡ÏÔòĬÈÏʹÓÃextended¡£
Optimize Table
¾­³£¸üÐÂÊý¾ÝµÄ´ÅÅÌÐèÒªÕûÀíËéƬ£¬Êý¾Ý¿âÒ²ÊÇÕâÑù£¬Optimize TableÓï¾ä¶ÔMyISAMºÍInnoDBÀàÐÍµÄ±í¶¼ÓÐЧ¡£
Èç¹û±í¾­³£¸üУ¬¾ÍÓ¦µ±¶¨ÆÚÔËÐÐOptimize TableÓï¾ä£¬±£Ö¤Ð§ÂÊ¡£
ÓëAnalyze TableÒ»Ñù£¬Optimize TableÒ²¿ÉÒÔʹÓÃlocalÀ´È¡ÏûдÈëbinlog¡£
Check Table
Êý¾Ý¿â¾­³£¿ÉÄÜÓöµ½´íÎó£¬Æ©ÈçÊý¾ÝдÈë´ÅÅÌʱ·¢Éú´íÎ󣬻òÊÇË


Ïà¹ØÎĵµ£º

mysqlÖ®ÄÚ´æ±í

 ÈçºÎ´´½¨ÄÚ´æ±í
£¿
    ´´½¨ÄÚ´æ±í·Ç³£µÄ¼òµ¥£¬Ö»Ðè×¢Ã÷ ENGINE=
MEMORY ¼´¿É:
    CREATE TABLE  `tablename` ( `columnName` varchar(256) NOT NUL)
ENGINE=MEMORY DEFAULT CHARSET=utf8 MAX_ROWS=100000000;
×¢Òâ
£º
   
µ±ÄÚ´æ±íÖеÄÊý¾Ý´óÓÚmax_ ......

MySQLÍü¼Ç¹ÜÀíÔ±ÃÜÂëµÄ½â¾ö·½·¨

linux:
Èç¹û MySQL ÕýÔÚÔËÐУ¬Ê×ÏÈɱ֮£º killall -TERM mysqld¡£
Æô¶¯ MySQL £º/usr/bin/safe_mysqld --skip-grant-tables &
¾Í¿ÉÒÔ²»ÐèÒªÃÜÂë¾Í½øÈë MySQL ÁË¡£
È»ºó¾ÍÊÇ
>use mysql
>update user set password=password("new_pass") where user="root";
>flush privileges;
ÖØÐÂɱ MySQL £¬ ......

MySQLÐÔÄÜÓÅ»¯TIPS

Ò». Æô¶¯²ÎÊýÓÅ»¯
ÐÞ¸Ä my.cnf (»òÕßmy.ini)£¬¼ÓÈë/ÐÞ¸ÄÒÔϼ¸ÐÐ
#É趨»º´æµÄÁ¬½ÓÊý,½ÚÊ¡Á¬½ÓʱµÄ¿ªÏú
back_log = 64
#½ûÓÃÎļþϵͳÍⲿËø
external-locking = 0
#½ûÓÃBDB,Èç¹ûÄãȷʵ²»ÐèÒªµÄ»°,innodbÒ²ÊÇÈç´Ë
skip-bdb
#Ë÷Òý»º³å,Èç¹ûÊÇרÓõÄÊý¾Ý¿â·þÎñÆ÷,¿ÉÒÔÉèÖøߴï·þÎñÆ÷ÄÚ´æµÄÒ»°ë,Èç¹û²»ÊÇרÓõÄ,
#»¹ÊÇÉ ......

MySQL ´æ´¢¹ý³Ì

£ÛתÔØ£ÝMySQL£ºMySQL ´´½¨´æ´¢¹ý³Ì£¨MySQL 5.0£©
2008-09-11 22:14
MySQL ´æ´¢¹ý³ÌÊÇ´Ó MySQL 5.0 ¿ªÊ¼Ôö¼ÓµÄй¦ÄÜ¡£´æ´¢¹ý³ÌµÄÓŵãÓÐÒ»Âá¿ð¡£²»¹ý×îÖ÷ÒªµÄ»¹ÊÇÖ´ÐÐЧÂʺÍSQL ´úÂë·â×°¡£ÌرðÊÇ SQL ´úÂë·â×°¹¦ÄÜ£¬Èç¹ûûÓд洢¹ý³Ì£¬ÔÚÍⲿ³ÌÐò·ÃÎÊÊý¾Ý¿âʱ£¨ÀýÈç PHP£©£¬Òª×éÖ¯ºÜ¶à SQL Óï¾ä¡£ÌرðÊÇÒµÎñÂß¼­¸´ÔÓµÄʱº ......

Windowsƽ̨¶àMYSQLÅäÖÃ(¶àMy.ini)

    ×î½üÔÚѧϰSSH£¬ÓÉÓÚΪÁ˽ÚÔ¼Äڴ棬ËùÒÔ¾Í×¼±¸Ê¹ÓÃMYSQL´úÌæOracle£¬ÎªÁ˸üÉîÒ»²½µØÁ˽âMySQL£¬ÓÚÊǾͼƻ®°²×°noinstall°æ±¾£¬Õâ°æ±¾±È°²×°°æ¿ÉÂ鷳һЩ£¬ÌرðÊÇÅäÖ÷½Ã棬Èç¹ûÅäÖúõĻ°¾Í¿ÉÒÔÔÚһ̨»úÆ÷ÉÏÔËÐжà¸ö°æ±¾µÄMYSQL£¬ÔÚÍøÉÏÕÒÁËÇ°±²ÃǵıʼǺóѧϰÍê±ÏºóÔټǼһ±Ê£¬¾ÍÎÒÕâ¼ÇÐÔ£¬¹À¼Æà ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ