ÅäÖÃMySQLÖ÷´Ó¸´ÖÆ(Replication)
MySQLÖ§³Öµ¥Ïò¡¢Òì²½¸´ÖÆ£¬¸´Öƹý³ÌÖÐÒ»¸ö·þÎñÆ÷³äµ±Ö÷·þÎñÆ÷£¬¶øÒ»¸ö»ò¶à¸öÆäËü·þÎñÆ÷³äµ±´Ó·þÎñÆ÷¡£Ö÷·þÎñÆ÷½«¸üÐÂдÈë¶þ½øÖÆÈÕÖ¾Îļþ£¬²¢Î¬»¤ÈÕÖ¾ÎļþµÄÒ»¸öË÷ÒýÒÔ¸ú×ÙÈÕ־ѻ·¡£µ±Ò»¸ö´Ó·þÎñÆ÷Á¬½Óµ½Ö÷·þÎñÆ÷ʱ£¬Ëü֪ͨÖ÷·þÎñÆ÷´Ó·þÎñÆ÷ÔÚÈÕÖ¾ÖжÁÈ¡µÄ×îºóÒ»´Î³É¹¦¸üеÄλÖᣴӷþÎñÆ÷½ÓÊÕ´ÓÄÇʱÆð·¢ÉúµÄÈκθüУ¬È»ºó·âËø²¢µÈ´ýÖ÷·þÎñÆ÷֪ͨÏÂÒ»´Î¸üС£
ΪʲôʹÓÃÖ÷´Ó¸´ÖÆ£¿
1¡¢Ö÷·þÎñÆ÷/´Ó·þÎñÆ÷ÉèÖÃÔö¼ÓÁ˽¡×³ÐÔ¡£Ö÷·þÎñÆ÷³öÏÖÎÊÌâʱ£¬Äã¿ÉÒÔÇл»µ½´Ó·þÎñÆ÷×÷Ϊ±¸·Ý¡£
2¡¢Í¨¹ýÔÚÖ÷·þÎñÆ÷ºÍ´Ó·þÎñÆ÷Ö®¼äÇзִ¦Àí¿Í»§²éѯµÄ¸ººÉ£¬¿ÉÒԵõ½¸üºÃµÄ¿Í»§ÏìӦʱ¼ä¡£µ«ÊDz»ÒªÍ¬Ê±ÔÚÖ÷´Ó·þÎñÆ÷ÉϽøÐиüУ¬ÕâÑù¿ÉÄÜÒýÆð³åÍ»¡£
3¡¢Ê¹Óø´ÖƵÄÁíÒ»¸öºÃ´¦ÊÇ¿ÉÒÔʹÓÃÒ»¸ö´Ó·þÎñÆ÷Ö´Ðб¸·Ý£¬¶ø²»»á¸ÉÈÅÖ÷·þÎñÆ÷¡£ÔÚ±¸·Ý¹ý³ÌÖÐÖ÷·þÎñÆ÷¿ÉÒÔ¼ÌÐø´¦Àí¸üС£
MySQLʹÓÃ3¸öÏß³ÌÀ´Ö´Ðи´Öƹ¦ÄÜ(ÆäÖÐ1¸öÔÚÖ÷·þÎñÆ÷ÉÏ£¬ÁíÁ½¸öÔÚ´Ó·þÎñÆ÷ÉÏ¡£µ±·¢³öSTART SLAVEʱ£¬´Ó·þÎñÆ÷´´½¨Ò»¸öI/OỊ̈߳¬ÒÔÁ¬½ÓÖ÷·þÎñÆ÷²¢ÈÃÖ÷·þÎñÆ÷·¢ËͶþ½øÖÆÈÕÖ¾¡£Ö÷·þÎñÆ÷´´½¨Ò»¸öÏ߳̽«¶þ½øÖÆÈÕÖ¾ÖеÄÄÚÈÝ·¢Ë͵½´Ó·þÎñÆ÷¡£´Ó·þÎñÆ÷I/OÏ̶߳ÁÈ¡Ö÷·þÎñÆ÷Binlog DumpÏ̷߳¢Ë͵ÄÄÚÈݲ¢½«¸ÃÊý¾Ý¿½±´µ½´Ó·þÎñÆ÷Êý¾ÝĿ¼Öеı¾µØÎļþÖУ¬¼´ÖмÌÈÕÖ¾¡£µÚ3¸öÏß³ÌÊÇSQLỊ̈߳¬´Ó·þÎñÆ÷ʹÓôËÏ̶߳ÁÈ¡ÖмÌÈÕÖ¾²¢Ö´ÐÐÈÕÖ¾Öаüº¬µÄ¸üС£SHOW PROCESSLISTÓï¾ä¿ÉÒÔ²éѯÔÚÖ÷·þÎñÆ÷ÉϺʹӷþÎñÆ÷ÉÏ·¢ÉúµÄ¹ØÓÚ¸´ÖƵÄÐÅÏ¢¡£
ĬÈÏÖмÌÈÕ־ʹÓÃhost_name-relay-bin.nnnnnnÐÎʽµÄÎļþÃû£¬ÆäÖÐhost_nameÊÇ´Ó·þÎñÆ÷Ö÷»úÃû£¬nnnnnnÊÇÐòÁкš£ÓÃÁ¬ÐøÐòÁкÅÀ´´´½¨Á¬ÐøÖмÌÈÕÖ¾Îļþ£¬´Ó000001¿ªÊ¼¡£´Ó·þÎñÆ÷¸ú×ÙÖмÌÈÕÖ¾Ë÷ÒýÎļþÀ´Ê¶±ðÄ¿Ç°ÕýʹÓõÄÖмÌÈÕÖ¾¡£Ä¬ÈÏÖмÌÈÕÖ¾Ë÷ÒýÎļþÃûΪhost_name-relay-bin.index¡£ÔÚĬÈÏÇé¿ö£¬ÕâЩÎļþÔÚ´Ó·þÎñÆ÷µÄÊý¾ÝĿ¼Öб»´´½¨¡£ÖмÌÈÕÖ¾Óë¶þ½øÖÆÈÕÖ¾µÄ¸ñʽÏàͬ£¬²¢ÇÒ¿ÉÒÔÓÃmysqlbinlog¶ÁÈ¡¡£µ±SQLÏß³ÌÖ´ÐÐÍêÖмÌÈÕÖ¾ÖеÄËùÓÐʼþºó£¬ÖмÌÈÕÖ¾½«»á±»×Ô¶¯É¾³ý¡£
´Ó·þÎñÆ÷ÔÚÊý¾ÝĿ¼ÖÐÁíÍâ´´½¨Á½¸ö״̬Îļþ--master.infoºÍrelay-log.info¡£×´Ì¬Îļþ±£´æÔÚÓ²ÅÌÉÏ£¬´Ó·þÎñÆ÷¹Ø±Õʱ²»»á¶ªÊ§¡£Ï´δӷþÎñÆ÷Æô¶¯Ê±£¬¶ÁÈ¡ÕâЩÎļþÒÔÈ·¶¨ËüÒѾ´ÓÖ÷·þÎñÆ÷¶ÁÈ¡Á˶àÉÙ¶þ½øÖÆÈÕÖ¾£¬ÒÔ¼°´¦Àí×Ô¼ºµÄÖмÌÈÕÖ¾µÄ³Ì¶È¡£
ÉèÖÃÖ÷´Ó¸´ÖÆ£º
1¡¢È·±£ÔÚÖ÷·þÎñÆ÷ºÍ´Ó·þÎñÆ÷ÉÏ°²×°µÄMySQL°æ±¾Ïàͬ£¬²¢ÇÒ×îºÃÊÇMySQLµÄ×îÐÂÎȶ¨°æ±¾¡£
2¡¢ÔÚÖ÷·þÎñ
Ïà¹ØÎĵµ£º
ÔÚ½üÆÚµÄÏîĿά»¤¹¤×÷ÖУ¬Ê±³£³öÏÖÖ÷¼üÖظ´µÄÒì³£¡£¾¹ýһϵÁÐ×ÊÁϵIJéѯ֮ºó£¬·¢ÏÖʱhibernateÓ³ÉäÎļþÅäÖÃÎÊÌâ¡£
mysqlÌṩÖ÷¼ü“×Ô¶¯ÔöÁ¿”µÄÅäÖã¬Ö¸¶¨¸ÃÀàÐ͵ÄÖ÷¼ü£¬mysqlÄܹ»×Ô¶¯¼ÓÒ»¡£
ÔÚhibernateÓ³ÉäÎļþÖУ¬¹ØÓÚÖ÷¼üµÄÅäÖò»ÄÜÊÇ
<generator class="increment"&g ......
ÏÂÔصØÖ·£ºhttp://download.csdn.net/down/434743/yuzhongqing2005
Navicat 8 for MySQLµÄ×¢²áÂ룺
PremiumSoft Navicat for MySQL Enterprise Edition v8.XX
ÐÕÃû(Name)£º3ddown.com
×éÖ¯(Organization)£º3ddown.com
×¢²áÂë(Serial)£ºNAVJ-W56S-3YUU-MVHV ......
×÷ÕߣºÀÏÍõ
MySQL5.X¶¼ÒѾ·¢²¼ºÃ¾ÃÁË£¬µ«ÊÇ»¹ÓкܶàÈËÈÏΪMySQLÊDz»Ö§³ÖÊÂÎñ´¦ÀíµÄ£¬Õâ²»µÃ²»¹ÖËûÃÇÊǹª¹ÑÎŵģ¬Æäʵ£¬Ö»ÒªÄãµÄMySQL°æ±¾Ö§³ÖBDB»òInnoDB±íÀàÐÍ£¬ÄÇôÄãµÄMySQL¾Í¾ßÓÐÊÂÎñ´¦ÀíµÄÄÜÁ¦¡£ÕâÀïÃ棬ÓÖÒÔInnoDB±íÀàÐÍÓõÄ×î¶à£¬ËäÈ»ºóÀ´·¢ÉúÁËÖîÈçOracleÊÕ¹ºInnoDBµÈÁîMySQL²»Ë¬µÄÊÂÇ飬µ«ÄÇЩÉÌÒµÉϵĶ·ÕùÓ ......
Ò»¡¢MySQL»ù±¾ÃüÁºÏ£º
1¡¢ create database mydata£»//´´½¨Êý¾Ý¿â
2¡¢ use mydata; //ÔÚmydataÕâ¸öÊý¾Ý¿âϹ¤×÷
3¡¢ create table dept //ÔÚmydataÊý¾Ý¿âÏ´´½¨±ídept
(
deptno int primary key,
dname varchar(14),
loc varchar(13)
);
create table emp / ......
Hibernate MySQL ÖÐÎÄÂÒÂëÎÊÌâ
»·¾³£ºHibernate 2.1.7 + MySQL4.1£¨MySQLµÄ±àÂëÒÑÉèÖÃΪutf8£©
ÎÊÌ⣺ͨ¹ýHibernateÏòMySQLдÈëÖÐÎĺó£¬Í¨¹ýHibernateÈ¡»ØÊý¾Ý£¬ÔÚconsoleÖдòÓ¡java¶ÔÏóÏÔʾÕý³£¡£µ«ÔÚMySQL Query BrowserÖп´µ½µÄÊÇÂÒÂ룬´«¸øÇ°¶ËµÄFlexÒ²ÊÇÂÒÂë¡£
ÔÒò£ºHibernateµÄ»ù´¡»¹ÊÇJDBC£¬ËùÒÔÒ»ÑùÐèÒªÉèÖà ......