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

mysql¼Ü¹¹·½°¸

Scale Out£ººáÏòÀ©Õ¹£¬Ôö¼Ó´¦Àí½ÚµãÌá¸ßÕûÌå´¦ÀíÄÜÁ¦
Scale Up£º×ÝÏòÀ©Õ¹£¬Í¨¹ýÌáÉýµ¥¸ö½ÚµãµÄ´¦ÀíÄÜÁ¦´ïµ½ÌáÉýÕûÌå´¦ÀíÄÜÁ¦µÄÄ¿µÄ
Replication
MySQLµÄreplicationÊÇÒì²½µÄ£¬ÊÊÓÃÓÚ¶ÔÊý¾ÝʵʱÐÔÒªÇó²»ÊÇÌرð¹Ø¼üµÄ³¡¾°¡£slave¶ËµÄIOÏ̸߳ºÔð´Ómaster¶ÁÈ¡ÈÕÖ¾£¬SQLÏß ³ÌרߺÔðÔÚslave¶ËÓ¦ÓôÓmaster¶Á¹ýÀ´µÄÈÕÖ¾£¨ÔçÆÚMySQLÓÃÒ»¸öÏß³ÌʵÏÖ£¬ÐÔÄÜÎÊÌâ±È½ÏÃ÷ÏÔ£©¡£Ê¹ÓÃreplication±ØÐëÆôÓà binary log£¬MySQLÓÃbinary logÏòslave·Ö·¢¸üÐÂ
¸´ÖƼ¶±ð
1. Row Level£º5.1.5¿ªÊ¼Ö§³Ö¡£mater¼Ç¼ÿÐÐÊý¾ÝµÄ¸ü¸ÄÈÕÖ¾£¬slave¸ù¾ÝÈÕÖ¾ÖðÐÐÓ¦Óá£Óŵ㣺Êý¾ÝÒ»ÖÂÐÔ¸üÓб£ÕÏ¡£È±µã£º¿ÉÄÜÔì³ÉÈÕÖ¾Îļþ±È½Ï´ó
2. Statement Level£ºmaster¼Ç¼ÿ¸öÖ´ÐеÄqueryÓï¾äÒÔ¼°Ò»Ð©ÉÏÏÂÎÄÐÅÏ¢£¬slave½Úµã¸ù¾ÝÕâЩÐÅÏ¢ÖØÐÂÔÚslaveÉÏÖ´ÐС£Óŵ㣺binary log±È½ÏС¡£È±µã£ºÄ³Ð©Çé¿öÏÂÊý¾ÝÒ»ÖÂÐÔÄÑÒÔ±£ÕÏ
3. Mixed Level£ºMySQL¸ù¾ÝÇé¿öÑ¡ÔñÄÄÖÖ¸´ÖÆ·½Ê½¡£5.1.8¿ªÊ¼Ö§³Ö
³£Óüܹ¹
1. Master-Slaves£ºÍ¨³£¶¼²ÉÓÃÕâÖÖ·½Ê½
2. Dual Master(Master-Master)£º2¸ömaster½Úµã»¥Ïàͬ²½¸üС£ÒòΪMySQLµÄÒì²½¸´ÖÆ·½Ê½£¬ÎªÁË·ÀÖ¹Êý¾Ý³åÍ»Ôì³ÉµÄ²»Ò»ÖÂÐÔ£¬Ò»°ã ½ö½«ÆäÖÐһ̨ÓÃÓÚд²Ù×÷£¬Áíһ̨²»Óûò½öÓÃÓÚ¶Á²Ù×÷¡£Ä¿µÄÊÇÆäÖÐһ̨masterÍ£»úά»¤»òÕß¹ÊÕÏÖжÏʱ¿ÉÒÔʹÓÃÁíһ̨master
3. ¼¶Áª¸´ÖÆ(Master-Slaves-Slaves)£ºÔÚMaster SlavesÖУ¬Èç¹ûslaves¹ý¶àreplication½«Ôö¼ÓmasterµÄ¸ºÔØ£¬Õâʱ¿ÉÒÔÈÃmasterÖ»ÏòÆäÖм¸Ì¨slave·Ö·¢¸üÐÂÈÕÖ¾£¬Õâ ¼¸Ì¨slave×÷Ϊһ¼¶½ÚµãÔÙÏòϼ¶½Úµã·Ö·¢¸üÐÂÈÕÖ¾
Cluster
Ö÷Ҫͨ¹ýNDB Cluster´æ´¢ÒýÇæʵÏÖ£¬ÊÇÒ»¸öShare NothingµÄ¼Ü¹¹£¬¸÷¸öMySQL ServerÖ®¼ä²¢²»ÐèÒª¹²ÏíÈκÎÊý¾Ý¡£¿ÉÒÔʵÏÖÈßÓࣨ¿É¿¿ÐÔ£©ÒÔ¼°¸ºÔؾùºâ¡£¸Õ¿ªÊ¼MySQLÐèÒªËùÓÐÊý¾ÝºÍË÷Òý¶¼Äܹ»¼ÓÔص½ÄÚ´æÖвÅÄÜʹÓà Cluster£¬¶ÔÄÚ´æÒªÇó¸ß£¬Ä¿Ç°Í¨¹ý¸Ä½øÖ»ÒªÇóË÷ÒýÄÜÈ«²¿¼ÓÔص½ÄÚ´æ
MySQL Clusrer¼Ü¹¹Ê¾Òâͼ£¬Í¼Æ¬À´×ÔMySQL¹Ù·½Îĵµ
1. SQL Nodes£º¸ºÔð´æ´¢²ãÖ®ÍâµÄÊÂÇ飬ÀýÈçÁ¬½Ó¹ÜÀí¡¢query´¦ÀíºÍÓÅ»¯¡¢cache¹ÜÀíµÈ£¬¼´°þÀëÁË´æ´¢²ãµÄMySQL·þÎñÆ÷
2. Data Nodes£º´æ´¢²ãµÄNDB½Úµã£¬¼´Cluster»·¾³ÏµĴ洢ÒýÇ档ÿ¸öcluster½Úµã±£´æÍêÕûÊý¾ÝµÄÒ»¸ö·ÖƬ£¬ÊÓ½ÚµãÊýÄ¿ºÍÅäÖöø¶¨£¬Ò»°ã data nodes±»×éÖ¯³ÉΪһ¸ö¸ögroup£¬Ã¿¸ögroup´æÓÐÒ»·ÝÍêÈ«ÏàͬµÄÎïÀíÊý¾Ý£¨ÈßÓࣩ¡£NDB´æ´¢ÒýÇæÊ×ÏÈ°´ÕÕÈßÓà²ÎÊýÅäÖÃÀ´Ê¹Óô洢½Úµã£¬È»ºó¸ù ¾Ý½ÚµãÊýÄ¿¶ÔÊý¾Ý½øÐзֶÎ
3. Management Server£º¸ºÔðÕ


Ïà¹ØÎĵµ£º

mysqlÖÐÌí¼ÓÍâ¼üÔ¼Êø

 ¾­³£Óõ½£¬µ«ÊÇ×ÜÊǼDz»×¡¡£
Óï·¨ÈçÏ£º
ALTER TABLE JOB ADD CONSTRAINT fk_prono
FOREIGN KEY(PRONO)
REFERENCES PROJECT(PRONO)
ON DELETE CASCADE
ON UPDATE NO ACTION;
ÎÒÔÚmysqlÖÐÌí¼ÓÁËÍâ¼üÔ¼Êø£¬ÊÔÁË°ëÌìû³É¹¦£¬ºóÀ´°ÑÍâ¼üµÄÃû×ÖÓÉFK¸Ä³ÉFK_1¾ÍºÃÁË£¬¿ÉÄÜmysqlÖÐFKÊǸö±£Áô×Ö£¬×¢Ò⣡ ......

MySQLÁ¬½Óʱ¿ìʱÂýµÄÎÊÌâ½â¾ö

 my.iniÀïµÄÄǸötmp_table_sizeµÄÖµ.Ô­À´tmp_table_size=16M.ÎÒ¸ÄΪ32M
È»ºóÖØÆôMYSQL»¹ÊÇû½â¾öÎÊÌâ.
Ö»ºÃÖØÆô·þÎñÆ÷ÊÔÊÔÁË,½á¹ûÖØÆôºóCPUÕý³£ÁË.²»¹ý»¹ÊÇûÕÒ³öÊÇʲôԭÒòµ¼ÖÂMYSQLÕ¼ÓÃÄÇô¶àCPU×ÊÔ´.
=====================================
ÐÞ¸ÄhostsÎļþ£¬¼ÓÈëÒ»ÐР  
172.16.59.12   & ......

LinuxÖв鿴ºÍÉèÖÃMySQLÊý¾Ý¿â×Ö·û¼¯(ת)

6
¡¢ÐÞ¸ÄÊý¾Ý¿âµÄ×Ö·û¼¯
mysql>use mydb
mysql>alter database mydb character set utf-8;
 
6
¡¢´´½¨Êý¾Ý¿âÖ¸¶¨Êý¾Ý¿âµÄ×Ö·û¼¯
mysql>create database mydb character set utf-8;
ͨ¹ýÅäÖÃÎļþÉèÖô´½¨Êý¾Ý¿âʱ×Ö·û¼¯:
#vi /var/lib/mysql/mydb/db.opt
default-character-set=latin1
default-col ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ