±¸·ÝMySQLÐèÒªÖªµÀµÄÊ®¼þÊÂ
ÄãʹÓùý±ðÈ˵ı¸·Ý·½°¸À´±¸·ÝÄãµÄMySQLÊý¾ÝÂð?ÄãÓжà¹ØÐÄÄãµÄÊý¾Ý?Äã¸ÒÈ·¶¨ÄãÏÖÔÚÕýÔÚÔËÐеĽű¾¾ÍÊÇ¿É¿¿µÄ£¬¿É»Ö¸´µÄ±¸·Ý£¬¶øÇÒÔÚÔËÐйý³ÌÖв»»áÓ°ÏìÄãµÄ¹Ø¼ü×÷ÒµÂð?ÔڻشðÕâ¸öÎÊÌâ֮ǰ£¬ÏȻشðÏÂÃæÊ®¸öÎÊÌâ°É£º
¡¡¡¡1. ±¸·ÝÒªÇóÍ£Ö¹Êý¾Ý¿âÂð?Èç¹û²»ÐèÒª£¬ÄÇô±¸·ÝµÄʱºò»áÓ°Ïìʲô?¿éÉ豸?I/O¸ºÔØ?»º³å?»òÕßÊÇÆäËû?
¡¡¡¡2. ±¸·ÝÓõÄÊÇʲô¼¼Êõ?ÊÇmysqldump»¹ÊÇÓë´ËÀàËƵĶ¨ÖÆ»¯²úÆ·?ÊôÓÚÎļþϵͳ¿½±´Ä£Ê½Âð?
¡¡¡¡3. ±¸·ÝϵͳÄÜÀí½â²»ÄÜͨ¹ý¼òµ¥µÄ¿½±´ÎļþÀ´±¸·ÝInnoDBÀàÐ͵ÄÊý¾ÝÂð?
¡¡¡¡4. ±¸·ÝʹÓÃÁËFLUSH TABLES, LOCK TABLES, »òÕßFLUSH TABLES WITH READ LOCKµÈSQLÓï¾äÂð?ËùÓÐÕâЩÓï¾ä¶¼»áÖжÏMySQL½ø³Ì¡£
¡¡¡¡5. MySQL»¹ÓÐÄÄЩÆäËû¹¦ÓÃ?ÎÒÔø¼û¹ýij¸ö±¸·ÝϵͳʹÓÃÁËRESET MASTERÓï¾ä£¬½á¹ûËüÁ¢Âí¾Í°Ñ¸´ÖÆ(replication)¸øÖжÏÁË, »¹ÓÐÆäËûFLUSH Óï¾äÂð?±ÈÈçFLUSH LOGS?
¡¡¡¡6. ±¸·ÝϵͳÄÜÈ·±£¿ÉÒÔÖ´ÐÐʱ¼äµã(point-in-time)»Ö¸´Âð?
¡¡¡¡7. ±¸·ÝϵͳÄÜÈ·±£binary log,InnoDB logsºÍ¸´ÖÆÊý¾Ý±£³ÖÒ»ÖÂÐÔÂð?
¡¡¡¡8. Äã¿ÉÒÔʹÓÃÕâ¸ö±¸·ÝϵͳÀ´ÉèÖÃÒ»¸öеĸ´ÖÆslave¶ËÂð?ÈçºÎ×öµ½?
¡¡¡¡9. ±¸·ÝϵͳУÑ鱸·ÝÊý¾ÝÊÇ·ñ¿É»Ö¸´?±ÈÈçËüÔÚÉú³É±¸·Ý³É¹¦Ö®Ç°ÊÇ·ñÔËÐйýInnoDB»Ö¸´²Ù×÷?
¡¡¡¡10. ËüÌṩ֧³Ö£¬È·±£¿ÉÔËÐУ¬¿É»Ö¸´±¸·ÝÂð?´Ó·¨ÂÉÒâÒåÉÏÀ´½²ËüµÄµ£±£ÄÜÔÚʲô³Ì¶È?
¡¡¡¡µ±È»£¬»¹ÐèÒªÌṩ¸ü¶àÆäËûÓ뱸·ÝÏà¹ØµÄһЩϸ½Ú£¬µ«ÊÇÎÒ¸öÈËÈÏΪ£¬¾ÍÕë¶ÔMySQL¶øÑÔ£¬ÕâЩÊDZȽÏÖØÒªµÄ¡£
¡¡¡¡½ÓÏÂÀ´ÄØ?Êǵģ¬ÎÒÓöµ½¹ýºÜ¶àÉ̼ÒÏúÊÛËûÃÇËûÃǺ¬Óи÷ÖÖMySQL±¸·ÝagentµÄ±¸·Ý²úÆ·£¬È»¶ø£¬ÎÒºÜÄÑ´ÓÆä»ñµÃ±È½ÏÏêϸµÄ¼¼Êõϸ½Ú£¬±ÈÈçËûÃǵı¸·ÝÊÇÈçºÎʵÏֵģ¬ÎÒÉõÖÁÁ¬×î»ù±¾µÄÐÅÏ¢£¬ÖîÈç“dump»òÕßÎļþ¿½±´”¶¼»ñÈ¡²»µ½¡£ÓÐʱ£¬ËûÃÇ»á¸æËßÎÒÈ¥¹Ù·½Õ¾µã×¢²áÈ»ºóÏÂÔØËùνµÄ°×ƤÊ飬¿ÉÊÇ°×ƤÊéÉϽö½öÖ»ÊÇд×Å“Ö§³ÖMySQLÊý¾Ý”»òÕßÊÇ“ÎÒÃÇÒѾ½«Äãת½Óµ½µØÇøÏúÊÛÈËÔ±”£¬È»¶øÎÒÈ´×ÜÊÇÕÒ²»µ½´ËÈË¡£
¡¡¡¡ËûÃÇÖеÄһЩÈËÉõÖÁʹÓÓרÀû”Õâ¸ö´ÊÀ´ÌÂÈûÎÒ£¬ËƺõÈÏΪÕâÊÇÒ»¸ö²»´íµÄÖ÷Ò⡣ʵ¼ÊÉÏ£¬Ò»¸öרÓеģ¬±£Ãܵĺںб¸·Ý·½°¸ÊDz»¿É½ÓÊܵġ£MySQL±¸·ÝÊǸ´Ôӵģ¬ÏëÕýȷʹÓñ¸·ÝÒ²±È½ÏÄÑ¡£³ý·ÇÎҷdz£Çå³þÕâ¸ö±¸·Ý²úÆ·ÊÇÈçºÎ¹¤×÷µÄ£¬·ñÔò£¬ÎÒ¸ù±¾¾Í²»¸Ò¸æËß¿Í»§Õâ¸ö¶«Î÷ÊÇ·ñ¿ÉÓá£
¡¡¡¡Òò´Ë£¬ÎÒÌṩÉÏÃæÕâ¸öÁбíµÄÄ¿µÄ¾ÍÊÇÓÃÀ´ÆÀ¹ÀÄ㽫ҪʹÓõı¸·Ý²úÆ·ÊÇ·ñÄܵ½´ïÁËÆóÒµ¼¶±¸·ÝÒªÇó¡£Èç¹ûÄã²»ÄܻشðÉÏÃæµÄÎÊÌ⣬ÒÀÎÒ¿´À´£¬Õâ¸
Ïà¹ØÎĵµ£º
1¡¢È¡×Ö¶Î×¢ÊÍ
Select COLUMN_NAME ÁÐÃû, DATA_TYPE ×Ö¶ÎÀàÐÍ, COLUMN_COMMENT ×Ö¶Î×¢ÊÍ
from INFORMATION_SCHEMA.COLUMNS
Where table_name = 'companies'##±íÃû
AND table_schema = 'testhuicard'##Êý¾Ý¿âÃû
AND column_name LIKE 'c_name'##×Ö¶ÎÃû
2¡¢È¡µÃ±í×¢ÊÍ
Select table_name ±íÃû,TABLE_COMMENT ±í×¢ÊÍ ......
ÉÏ´ÎÔÚÅöµ½ÕâÎÊÌ⣬ÔÚÍøÉÏÕÒÁ˽â¾ö·½·¨£¬¿ÉÊÇû¼ÇÏÂÀ´¡£ÕâÐÇÆÚÒª»»»úÆ÷£¬Òª°ÑÔÀ´linuxϵÄmysqlÊý¾Ý¿âÒƵ½Áíһ̨·þÎñÆ÷ÉÏ¡£°²×°suseϵͳ¡¢ÔÙÅäÖÃtelnet¡¢ftp·þÎñ¡¢°²×°java JDK²¢ÅäÖá¢ÔÙ°²×°eclipseºÍmysql,ÓÖ»¨ÁËÒ»ÌìµÄʱ¼ä¡£¸Ð¾õ»¹ÊDz»ÊìÁ·£¬ÅäÖ÷À»ðǽÀÏÊDz»Äܽ«telnetºÍftp·þÎñÅÅÍâ¡£mysqlÓÖÅöµ½ÁËÖÐÎÄÂÒÂëÎÊÌ⣬ÓÖÔÚ ......
½ñÌìΪÁË°²×°MySQl£¬¸ãÁË5¸ö¶àÖÓ£¬ÖÐÎç·¹¶¼Ã»³Ô£¬ÏÈÊÇstart service ²»Í¨¹ý£¬ÔÙÊÇApply security settings ²»Í¨¹ý£¨±¨Á˸ö1045µÄError£©£¬ºóÀ´ÖÕÓÚTMDµÄ¸ãµ½Ëüͨ¹ýÁË£¬½â¾ö°ì·¨ÈçÏ£º
¡¶µÚÒ»Öֳɹ¦£¬µÚ¶þºÍµÚÈýÖÖûÊÔ¡·£¬µÚ¶þºÍµÚÈýÊDZðÈËÌṩµÄ¡£
·½·¨Ò»£º
1, жÔØMySQL
2, ɾ³ýĿ¼ C:\Documents and Settings\Óû§Ãû ......
Á¬½Ó£ºmysql -hÖ÷»úµØÖ· -uÓû§Ãû £pÓû§ÃÜÂë £¨×¢:uÓëroot¿ÉÒÔ²»Óüӿոñ£¬ÆäËüÒ²Ò»Ñù£©
¶Ï¿ª£ºexit £¨»Ø³µ£©
´´½¨ÊÚȨ£ºgrant select on Êý¾Ý¿â.* to Óû§Ãû@µÇ¼Ö÷»ú identified by \"ÃÜÂë\"
ÐÞ¸ÄÃÜÂ룺mysqladmin -uÓû§Ãû -p¾ÉÃÜÂë password ÐÂÃÜÂë
ɾ³ýÊÚȨ: revoke select,insert,update,delete om *.* from ......
ÔÚmysqlÖÐÊäÈëSHOW variables like "have_%"²é¿´£¬ÏÔʾÈçÏ£º
mysql> SHOW variables like "have_%";
+-----------------------+----------+
| Variable_name | Value |
+-----------------------+----------+
| have_archive   ......