| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> mysql >> xiang xi jiang jie MySQL shu ju ku shuang ji re bei de pei zhi fang fa

xiang xi jiang jie MySQL shu ju ku shuang ji re bei de pei zhi fang fa

2008-06-01 03:26:39 编辑來源:互联网 评论
 
 
 
本文为【详细讲解MySQL数据库双机热备的配置方法】的拼音翻译版
  MySQL shu ju ku shuang ji re bei de pei zhi fang fa :
  ◆1.MySQL shu ju ku mei you zeng liang bei fen de ji zhi , dang shu ju liang tai da de shi hou bei fen shi yi ge hen da de wen ti 。 huan hao MySQL shu ju ku ti gong le yi zhong zhu cong bei fen de ji zhi , qi shi jiu shi ba zhu shu ju ku de suo you de shu ju tong shi xie dao bei fen shu ju ku zhong 。 shi xian MySQL shu ju ku de re bei fen 。
  ◆2. yao xiang shi xian shuang ji de re bei shou xian yao le jie zhu cong shu ju ku fu wu qi de ban ben de xu qiu 。 yao shi xian re bei MySQL de ban ben dou yao gao yu 3.2, huan you yi ge ji ben de yuan ze jiu shi zuo wei cong shu ju ku de shu ju ku ban ben ke yi gao yu zhu fu wu qi shu ju ku de ban ben , dan shi bu ke yi di yu zhu fu wu qi de shu ju ku ban ben 。
  ◆3. she zhi zhu shu ju ku fu wu qi :
  ·a. shou xian cha kan zhu fu wu qi de ban ben shi fou shi zhi chi re bei de ban ben 。 ran hou cha kan my.cnf( lei unix) huo zhe my.ini(windows) zhong mysqld pei zhi kuai de pei zhi you mei you log-bin( ji lu shu ju ku geng gai ri zhi ), yin wei MySQL de fu zhi ji zhi shi ji yu ri zhi de fu zhi ji zhi , suo yi zhu fu wu qi yi ding yao zhi chi geng gai ri zhi cai xing 。 ran hou she zhi yao xie ru ri zhi de shu ju ku huo zhe bu yao xie ru ri zhi de shu ju ku 。 zhe yang zhi you nin gan xing qu de shu ju ku de geng gai cai xie ru dao shu ju ku de ri zhi zhong 。
  server-id=1 // shu ju ku de id zhe ge ying gai mo ren shi 1 jiu bu yong gai dong
  log-bin=log_name // ri zhi wen jian de ming cheng , zhe li ke yi zhi ding ri zhi dao bie de mu lu ru guo mei you she zhi ze mo ren zhu ji ming de yi ge ri zhi ming cheng
  binlog-do-db=db_name // ji lu ri zhi de shu ju ku
  binlog-ignore-db=db_name // bu ji lu ri zhi de shu ju ku
  yi shang de ru guo you duo ge shu ju ku yong "," fen ge kai
  ran hou she zhi tong bu shu ju ku de yong hu zhang hao
  mysql> GRANT REPLICATION SLAVE ON *.*
  -> TO 'repl'@'%.mydomain.com' IDENTIFIED BY 'slavepass';
  4.0.2 yi qian de ban ben , yin wei bu zhi chi REPLICATION yao shi yong xia mian de yu ju lai shi xian zhe ge gong neng
  mysql> GRANT FILE ON *.*
  -> TO 'repl'@'%.mydomain.com' IDENTIFIED BY 'slavepass';
  she zhi hao zhu fu wu qi de pei zhi wen jian hou chong xin qi dong shu ju ku
  ·b. suo ding xian you de shu ju ku bing bei fen xian zai de shu ju
  suo ding shu ju ku
  mysql> FLUSH TABLES WITH READ LOCK;
  bei fen shu ju ku you liang zhong ban fa yi zhong shi zhi jie jin ru dao MySQL de data mu lu ran hou da bao ni xu yao bei fen shu ju ku de wen jian jia , di er zhong shi shi yong mysqldump de fang shi lai bei fen shu ju ku dan shi yao jia shang "--master-data " zhe ge shen shu , jian yi shi yong di yi zhong fang fa lai bei fen shu ju ku
  ·c. cha kan zhu fu wu qi de zhuang tai
  mysql> show master status\G;
  +---------------+----------+--------------+------------------+
  | File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
  +---------------+----------+--------------+------------------+
  | mysql-bin.003 | 73 | test | manual,mysql |
  +---------------+----------+--------------+------------------+
  ji lu File he Position xiang mu de zhi , yin wei yi hou yao yong 。
  ·d. ran hou ba shu ju ku de suo ding da kai
  mysql> UNLOCK TABLES;
  ◆4. she zhi cong fu wu qi
  a. shou xian she zhi shu ju ku de pei zhi wen jian
  server-id=n // she zhi shu ju ku id mo ren zhu fu wu qi shi 1 ke yi sui bian she zhi dan shi ru guo you duo tai cong fu wu qi ze bu neng chong fu 。
  master-host=db-master.mycompany.com // zhu fu wu qi de IP di zhi huo zhe yu ming
  master-port=3306 // zhu shu ju ku de duan kou hao
  master-user=pertinax // tong bu shu ju ku de yong hu
  master-password=freitag // tong bu shu ju ku de mi ma
  master-connect-retry=60 // ru guo cong fu wu qi fa xian zhu fu wu qi duan diao , chong xin lian jie de shi jian cha
  report-host=db-slave.mycompany.com // bao gao cuo wu de fu wu qi
  b. ba cong zhu shu ju ku fu wu qi bei fen chu lai de shu ju ku dao ru dao cong fu wu qi zhong
  c. ran hou qi dong cong shu ju ku fu wu qi , ru guo qi dong de shi hou mei you jia shang "--skip-slave-start" zhe ge shen shu ze jin ru MySQL zhong
  mysql> slave stop; // ting zhi slave de fu wu
  d. she zhi zhu fu wu qi de ge zhong shen shu
  mysql> CHANGE MASTER TO
  -> MASTER_HOST='master_host_name', // zhu fu wu qi de IP di zhi
  -> MASTER_USER='replication_user_name', // tong bu shu ju ku de yong hu
  -> MASTER_PASSWORD='replication_password', // tong bu shu ju ku de mi ma
  -> MASTER_LOG_FILE='recorded_log_file_name', // zhu fu wu qi er jin zhi ri zhi de wen jian ming ( qian mian yao qiu ji zhu de shen shu )
  -> MASTER_LOG_POS=recorded_log_position; // ri zhi wen jian de kai shi wei zhi ( qian mian yao qiu ji zhu de shen shu )
  e. qi dong tong bu shu ju ku de xian cheng
  mysql> slave start;
  cha kan shu ju ku de tong bu qing kuang ba 。 cheng gong tong bu !
  cha kan zhu cong fu wu qi de zhuang tai
  mysql> SHOW PROCESSLIST\G // ke yi cha kan mysql de jin cheng kan kan shi fou you jian ting de jin cheng
  ru guo ri zhi tai da qing chu ri zhi de bu zhou ru xia :
  1. suo ding zhu shu ju ku
  mysql> FLUSH TABLES WITH READ LOCK;
  2. ting diao cong shu ju ku de slave
  mysql> slave stop;
  3. cha kan zhu shu ju ku de ri zhi wen jian ming he ri zhi wen jian de position
  show master status;
  +---------------+----------+--------------+------------------+
  | File | Position | Binlog_do_db | Binlog_ignore_db |
  +---------------+----------+--------------+------------------+
  | louis-bin.001 | 79 | | mysql |
  +---------------+----------+--------------+------------------+
  4. jie kai zhu shu ju ku de suo
  mysql> unlock tables;
  5. geng xin cong shu ju ku zhong zhu shu ju ku de xin xi
  mysql> CHANGE MASTER TO
  -> MASTER_HOST='master_host_name', // zhu fu wu qi de IP di zhi
  -> MASTER_USER='replication_user_name', // tong bu shu ju ku de yong hu
  -> MASTER_PASSWORD='replication_password', // tong bu shu ju ku de mi ma
  -> MASTER_LOG_FILE='recorded_log_file_name', // zhu fu wu qi er jin zhi ri zhi de wen jian ming ( qian mian yao qiu ji zhu de shen shu )
  -> MASTER_LOG_POS=recorded_log_position; // ri zhi wen jian de kai shi wei zhi ( qian mian yao qiu ji zhu de shen shu )
  6. qi dong cong shu ju ku de slave
  mysql> slave start;【原文】【汉音对照
 
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
MySQL shu ju ku shuang ji re bei de pei zhi fang fa : ◆1.MySQL shu ju ku mei you zeng liang bei fen de ji zhi , dang shu ju liang tai da de shi hou bei fen shi yi ge hen da de wen ti 。 huan hao MySQL shu ju ku ti gong le yi zhong zhu cong bei fen de ji zhi , qi shi jiu shi ba zhu shu ju ku de suo you de shu ju tong shi xie dao bei fen shu ju ku zhong 。 shi xian MySQL shu ju ku de re bei fen 。 ◆2. yao xiang shi xian shuang ji de re bei shou xian yao le jie zhu cong shu ju ku fu wu qi de ban ben de xu qiu 。 yao shi xian re bei MySQL de ban ben dou yao gao yu 3.2, huan you yi ge ji ben de yuan ze jiu shi zuo wei cong shu ju ku de shu ju ku ban ben ke yi gao yu zhu fu wu qi shu ju ku de ban ben , dan shi bu ke yi di yu zhu fu wu qi de shu ju ku ban ben 。 ◆3. she zhi zhu shu ju ku fu wu qi : ·a. shou xian cha kan zhu fu wu qi de ban ben shi fou shi zhi chi re bei de ban ben 。 ran hou cha kan my.cnf( lei unix) huo zhe my.ini(windows) zhong mysqld pei zhi kuai de pei zhi you mei you log-bin( ji lu shu ju ku geng gai ri zhi ), yin wei MySQL de fu zhi ji zhi shi ji yu ri zhi de fu zhi ji zhi , suo yi zhu fu wu qi yi ding yao zhi chi geng gai ri zhi cai xing 。 ran hou she zhi yao xie ru ri zhi de shu ju ku huo zhe bu yao xie ru ri zhi de shu ju ku 。 zhe yang zhi you nin gan xing qu de shu ju ku de geng gai cai xie ru dao shu ju ku de ri zhi zhong 。 server-id=1 // shu ju ku de id zhe ge ying gai mo ren shi 1 jiu bu yong gai dong log-bin=log_name // ri zhi wen jian de ming cheng , zhe li ke yi zhi ding ri zhi dao bie de mu lu ru guo mei you she zhi ze mo ren zhu ji ming de yi ge ri zhi ming cheng binlog-do-db=db_name // ji lu ri zhi de shu ju ku binlog-ignore-db=db_name // bu ji lu ri zhi de shu ju ku yi shang de ru guo you duo ge shu ju ku yong "," fen ge kai ran hou she zhi tong bu shu ju ku de yong hu zhang hao mysql> GRANT REPLICATION SLAVE ON *.* -> TO 'repl'@'%.mydomain.com' IDENTIFIED BY 'slavepass'; 4.0.2 yi qian de ban ben , yin wei bu zhi chi REPLICATION yao shi yong xia mian de yu ju lai shi xian zhe ge gong neng mysql> GRANT FILE ON *.* -> TO 'repl'@'%.mydomain.com' IDENTIFIED BY 'slavepass'; she zhi hao zhu fu wu qi de pei zhi wen jian hou chong xin qi dong shu ju ku ·b. suo ding xian you de shu ju ku bing bei fen xian zai de shu ju suo ding shu ju ku mysql> FLUSH TABLES WITH READ LOCK; bei fen shu ju ku you liang zhong ban fa yi zhong shi zhi jie jin ru dao MySQL de data mu lu ran hou da bao ni xu yao bei fen shu ju ku de wen jian jia , di er zhong shi shi yong mysqldump de fang shi lai bei fen shu ju ku dan shi yao jia shang "--master-data " zhe ge shen shu , jian yi shi yong di yi zhong fang fa lai bei fen shu ju ku ·c. cha kan zhu fu wu qi de zhuang tai mysql> show master status\G; +---------------+----------+--------------+------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | +---------------+----------+--------------+------------------+ | mysql-bin.003 | 73 | test | manual,mysql | +---------------+----------+--------------+------------------+ ji lu File he Position xiang mu de zhi , yin wei yi hou yao yong 。 ·d. ran hou ba shu ju ku de suo ding da kai mysql> UNLOCK TABLES; ◆4. she zhi cong fu wu qi a. shou xian she zhi shu ju ku de pei zhi wen jian server-id=n // she zhi shu ju ku id mo ren zhu fu wu qi shi 1 ke yi sui bian she zhi dan shi ru guo you duo tai cong fu wu qi ze bu neng chong fu 。 master-host=db-master.mycompany.com // zhu fu wu qi de IP di zhi huo zhe yu ming master-port=3306 // zhu shu ju ku de duan kou hao master-user=pertinax // tong bu shu ju ku de yong hu master-password=freitag // tong bu shu ju ku de mi ma master-connect-retry=60 // ru guo cong fu wu qi fa xian zhu fu wu qi duan diao , chong xin lian jie de shi jian cha report-host=db-slave.mycompany.com // bao gao cuo wu de fu wu qi b. ba cong zhu shu ju ku fu wu qi bei fen chu lai de shu ju ku dao ru dao cong fu wu qi zhong c. ran hou qi dong cong shu ju ku fu wu qi , ru guo qi dong de shi hou mei you jia shang "--skip-slave-start" zhe ge shen shu ze jin ru MySQL zhong mysql> slave stop; // ting zhi slave de fu wu d. she zhi zhu fu wu qi de ge zhong shen shu mysql> CHANGE MASTER TO -> MASTER_HOST='master_host_name', // zhu fu wu qi de IP di zhi -> MASTER_USER='replication_user_name', // tong bu shu ju ku de yong hu -> MASTER_PASSWORD='replication_password', // tong bu shu ju ku de mi ma -> MASTER_LOG_FILE='recorded_log_file_name', // zhu fu wu qi er jin zhi ri zhi de wen jian ming ( qian mian yao qiu ji zhu de shen shu ) -> MASTER_LOG_POS=recorded_log_position; // ri zhi wen jian de kai shi wei zhi ( qian mian yao qiu ji zhu de shen shu ) e. qi dong tong bu shu ju ku de xian cheng mysql> slave start; cha kan shu ju ku de tong bu qing kuang ba 。 cheng gong tong bu ! cha kan zhu cong fu wu qi de zhuang tai mysql> SHOW PROCESSLIST\G // ke yi cha kan mysql de jin cheng kan kan shi fou you jian ting de jin cheng ru guo ri zhi tai da qing chu ri zhi de bu zhou ru xia : 1. suo ding zhu shu ju ku mysql> FLUSH TABLES WITH READ LOCK; 2. ting diao cong shu ju ku de slave mysql> slave stop; 3. cha kan zhu shu ju ku de ri zhi wen jian ming he ri zhi wen jian de position show master status; +---------------+----------+--------------+------------------+ | File | Position | Binlog_do_db | Binlog_ignore_db | +---------------+----------+--------------+------------------+ | louis-bin.001 | 79 | | mysql | +---------------+----------+--------------+------------------+ 4. jie kai zhu shu ju ku de suo mysql> unlock tables; 5. geng xin cong shu ju ku zhong zhu shu ju ku de xin xi mysql> CHANGE MASTER TO -> MASTER_HOST='master_host_name', // zhu fu wu qi de IP di zhi -> MASTER_USER='replication_user_name', // tong bu shu ju ku de yong hu -> MASTER_PASSWORD='replication_password', // tong bu shu ju ku de mi ma -> MASTER_LOG_FILE='recorded_log_file_name', // zhu fu wu qi er jin zhi ri zhi de wen jian ming ( qian mian yao qiu ji zhu de shen shu ) -> MASTER_LOG_POS=recorded_log_position; // ri zhi wen jian de kai shi wei zhi ( qian mian yao qiu ji zhu de shen shu ) 6. qi dong cong shu ju ku de slave mysql> slave start;
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
华丽的模特拍摄(8)
华丽的模特拍摄(7)
华丽的模特拍摄(6)
华丽的模特拍摄(5)
八里沟
朝阳宫
天下峨眉 云上金顶
老家(四)
 
>>返回首页<<
 
 
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
 
©2005- 王朝网络 版权所有