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

MySQLÖ÷´Ó·þÎñÆ÷£¨Replication£©µÄÉèÖÃ

Ê×ÏÈÉèÖÃMySQLÖ÷·þÎñÆ÷£º
ÔÚÖ÷·þÎñÆ÷ÉÏΪ´Ó·þÎñÆ÷½¨Á¢Ò»¸öÓû§£º
grant replication slave on *.* to 'Óû§Ãû'@'Ö÷»ú' identified by 'ÃÜÂë';
Èç¹ûʹÓõÄÊÇMySQL 4.0.2֮ǰµÄ°æ±¾£¬ÔòÓÃfileȨÏÞÀ´´úÌæreplication slave
±à¼­Ö÷·þÎñÆ÷µÄÅäÖÃÎļþ£º/etc/my.cnf
server-id=1
log-bin
binlog-do-db=ÐèÒª¸´ÖƵÄÊý¾Ý¿âÃû£¬Èç¹û¸´Öƶà¸öÊý¾Ý¿â£¬Öظ´ÉèÖÃÕâ¸öÑ¡Ïî¼´¿É
binlog-ignore-db=²»ÐèÒª¸´ÖƵÄÊý¾Ý¿â¿àÃü£¬Èç¹û¸´Öƶà¸öÊý¾Ý¿â£¬Öظ´ÉèÖÃÕâ¸öÑ¡Ïî¼´¿É
×¢Ò⣺Èç¹ûÄãÏë×öÒ»¸ö¸´ÔÓµãµÄ½á¹¹£º±ÈÈç˵£¬A->B->C£¬ÆäÖÐBÊÇAµÄ´Ó·þÎñÆ÷£¬Í¬Ê±BÓÖÊÇCµÄÖ÷·þÎñÆ÷£¬ÄÇôB·þÎñÆ÷³ýÁËÐèÒª´ò¿ªlog-binÖ®Í⣬»¹ÐèÒª´ò¿ªlog-slave-updatesÑ¡ÏÄã¿ÉÒÔÔÙBÉÏʹÓÓshow variables like 'log%';”À´È·ÈÏÊÇ·ñÒѾ­ÉúЧ¡£
±à¼­´Ó·þÎñÆ÷µÄÅäÖÃÎļþ£º/etc/my.cnf
server-id=2
master-host=Ö÷»ú
master-user=̞
master-password=ÃÜÂë
master-port=¶Ë¿Ú
replicate-do-db=ÐèÒª¸´ÖƵÄÊý¾Ý¿âÃû£¬Èç¹û¸´Öƶà¸öÊý¾Ý¿â£¬Öظ´ÉèÖÃÕâ¸öÑ¡Ïî¼´¿É
replicate-ignore-db=ÐèÒª¸´ÖƵÄÊý¾Ý¿âÃû£¬Èç¹û¸´Öƶà¸öÊý¾Ý¿â£¬Öظ´ÉèÖÃÕâ¸öÑ¡Ïî¼´¿É
ÅäÖÃÖ÷´Ó·þÎñÆ÷µÄmy.cnfʱ£¬ÁôÐĸ÷×ÔµÄserver-idÒ»¶¨Òª±Ë´Ë¶ÀÁ¢£¬²»ÄÜÖظ´£¬·ñÔò£¬»á³öÏÖÈçÏ´íÎó£º
Slave: received end packet from server, apparent master shutdown
ÁíÒ»¸öÐèҪעÒâµÄÊÇ×îºÃÔÚ´Ó·þÎñÆ÷µÄmy.cnfÀïÉèÖÃread_onlyÑ¡Ï·ÀÖ¹·¢ÉúÒâÍ⣨Á¬½ÓÓû§²»ÄÜÓÐSUPERȨÏÞ£¬·ñÔòÎÞЧ£©¡£
¼ÇµÃÏÈÊÖ¶¯Í¬²½Ò»ÏÂÖ÷´Ó·þÎñÆ÷£¬Êý¾ÝÁ¿Ð¡µÄ»°¿ÉÒÔÓÃmysqldump£¬ËüÓÐÒ»¸ömaster-data²ÎÊýºÜÓÐÓã¬Í¨¹ýʹÓô˲ÎÊý£¬µ¼³öµÄSQLÎļþÀï»á×Ô¶¯°üº¬CHANGE MASTER TO MASTER_LOG_FILE='...', MASTER_LOG_POS=...;£¬ÕâÑù´´½¨´Ó·þÎñÆ÷¾Í¸ü·½±ãÁË¡£
Èç¹ûÊý¾ÝÁ¿´óµÄ»°²»Ì«ÊʺÏʹÓÃmysqldump£¨Âý£©£¬Èç¹ûÊÇmyisam±íµÄ»°£¬¼ÓÉÏ--lock-all-tables²ÎÊý£¬Èç¹ûÊÇinnodb±íµÄ»°£¬¼ÓÉÏ--single-transaction²ÎÊý¡£
¶øÓ¦¸Ã²ÉÓÿ½±´ÎļþµÄ·½Ê½£¬Çë°´ÈçϲÙ×÷²½Ö裺
ÏÈÔÚÖ÷·þÎñÆ÷ÉÏËø¶¨ËùÓÐµÄ±í£¬ÒÔÃâÔÚ¸´Öƹý³ÌÖÐÊý¾Ý·¢Éú±ä»¯£º
mysql> flush tables with read lock;
È»ºóÔÚÖ÷·þÎñÆ÷Éϲéѯµ±Ç°¶þ½øÖÆÎļþµÄÎļþÃû¼°Æ«ÒÆλÖãº
mysql > show master status;
È»ºóÍ£Ö¹Ö÷·þÎñÆ÷ÉϵÄMySQL·þÎñ£º
shell> mysqladmin -u root shutdown
×¢Ò⣺Èç¹û½öÊÇMyISAMµÄ»°£¬¿ÉÒÔ²»Í£Ö¹MySQL·þÎñ£¬µ«ÒªÔÚ¸´ÖÆÊý¾ÝÎļþµÄ¹ý³ÌÖб£³ÖÖ»¶ÁËø£¬Èç¹ûÊÇIn


Ïà¹ØÎĵµ£º

»ùÓÚMySQLÊý¾Ý¿âµÄUTF8ÖÐÎÄÍøվȫÎļìË÷µÄʵÏÖ


http://hi.baidu.com/xiyouwang/blog/item/9f15bbee99b0ce202df5349e.html
ÏÖÔڵĻ¥ÁªÍøÉÏ£¬ºÜ¶àÍøÕ¾¶¼ÌṩÁËÈ«ÎÄËÑË÷¹¦ÄÜ£¬ä¯ÀÀÕß¿ÉÒÔͨ¹ýÊäÈë¹Ø¼ü×Ö»òÕßÊǶÌÓïÀ´ËÑË÷Ìض¨µÄ×ÊÁÏ¡£ÔÚPHP+MySQL¹¹¼ÜµÄÍøÕ¾ÖУ¬Í¨³£µÄ×ö·¨ÊÇͨ¹ýSELECT²éѯµÄLikeÓï¾äÀ´½øÐÐËÑË÷£¬ÕâÒ»°ì·¨´æÔÚËÑË÷²»¹»¾«È·¡¢ÒÔ¼°Ð§Âʷdz£µÍϵÄȱµã¡£±ÈÈç¶Ô ......

pbÁ¬½ÓmySqlÊý¾Ý¿â

PBÁ¬½ÓMySQLÊý¾Ý¿â
 
È¥mysqlµÄ¹Ù·½ÍøÕ¾ÏÂÔØodbc connector(http://dev.mysql.com/downloads/connector/odbc/)
ÏÂÔصÄÊÇmysql-connector-odbc-noinstall-5.1.6-win32.zip
½âѹºóÖ±½ÓÔËÐÐÎļþ¼ÐÖÐµÄ Install.bat Åú´¦ÀíÎļþ
mysql-connectorÓкü¸ÖÖ£¬Ñ¡ÔñÒ»¸ö×Ô¼ºÏ²»¶µÄ¼´¿É¡£
ÔÚxpÖдò¿ªODBCÊý¾ÝÔ´¹ÜÀíÆ÷£¨¿ØÖ ......

MySQL 6.0Ãâ°²×°ÅäÖÃ

1.ÏÂÔØ MySQL 6.0Ãâ°²×°°æ
http://dev.mysql.com/get/Downloads/MySQL-6.0/mysql-noinstall-6.0.9-alpha-win32.zip/from/pick#mirrors
2.½« MySQL6.0 ½âѹµ½´ý°²×°Ä¿Â¼(×Ô¼º¾ö¶¨·Åµ½ÄÄ£©¡£½âѹºóĬÈÏÎļþ¼ÐÃû³ÆΪ£ºmysql-6.0.9-alpha-win32£¨µ±È»¿ÉÒÔ×Ô¼º¸ü¸Ä£©£¬È»ºóÔÚ»·¾³±äÁ¿ÖÐÉèÖÃMYSQL_HOME£¨ÕâÑù£¬ÒÔºó¿ÉÒÔÓÃ%MYSQL ......

MySQL±íÀàÐͼòµ¥¶Ô±È

MySQLΪÎÒÃÇÌṩÁ˺ܶà±íÀàÐ͹©Ñ¡Ôñ£¬ÓÐMyISAM¡¢ISAM¡¢HEAP¡¢BerkeleyDB¡¢InnoDB£¬MERGE±íÀàÐÍÿһÖÖ±íÀàÐͶ¼ÓÐÆä×Ô¼ºµÄÊôÐÔºÍÓŵ㡣ÏÂÃæÎÒÃÇÀ´¼òµ¥µÄÌÖÂÛһϡ£
MyISAM±íÀàÐÍ£º
MyISAM
±í(TYPE=MYISAM)ÊÇISAMÀàÐ͵ÄÒ»ÖÖÑÓÉ죬¾ßÓкܶàÓÅ»¯ºÍÔöÇ¿µÄÌØÐÔ¡£ÊÇMySQLµÄĬÈϱíÀàÐÍ¡£MyISAMÓÅ»¯ÁËѹËõ±ÈÀýºÍËٶȣ¬²¢ÇÒ
¿ÉÒ& ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ