MySQL???????????????÷???
?????yishouwangnian????? ???????[ 2016/10/24 10:00:35 ] ????????????? MySQL
???????????????????????????server-id????????????????????????????
?????????????????InnoDB???????????????????????????
?????????????????my.cnf????????innodb_flush_log_at_trx_commit=1??sync-binlog=1??
????mysql> show variables; (??????read-only?????????slave????slave?????????SUPER??????????????????????????slave?????????????????????????)
????mysql> show processlist; (??????slave-start)
?????????mysql???????slave??
????mysqld_safe –user=mysql –read-only & (???MySQL?????????????slave??I/O???)
????mysql> SHOW SLAVE STATUSG;
????5.?л?slave?master????slave???
????mysql> STOP SLAVE;
????mysql> RESET MASTER;
??????.??????????
????–read_only
???????????????????????????????????????SUPER?????????????????????????????????????????????
????–replicate_do_db=db_name
?????????????????????????(??USE?????)?db_name??????????????????????????????????????????????Ρ????????????????????
????–replicate_do_table=db_name.tbl_name
???????????????????????????????????????????????????????????????Ρ??–replicate-do-db??????????????????
????–replicate_ignore_db=db_name
?????????????????????????????(??USE?????)?db_name??????????????????????????????????????????Ρ?
????–replicate-ignore-table=db_name.tbl_name
?????????????????????????????????κ????(?????????????????????)??????????????????????????????????Ρ?
????–replicate_wild_do_table=db_name.tbl_name
??????????????????????????μ???????????????????????????????????‘%’??‘_’????????LIKE?????????????????????塣???????????????????????????????Ρ?????????????????и????
????–replicate_wild_ignore_table=db_name.tbl_name
???????????????????????????????????????????????????????????????????????????Ρ?????????????????и????
????–replicate_rewrite_db=from_name->to_name
?????????????????????????(??USE?????)????????????from_name???????to_name???????б?????
????–report_host=slave_name
??????????????????б??????????????????????IP????????????????????????SHOW SLAVE HOSTS??????С????????????????????????????????????????????
????–report_port=slave_port
????????????????TCP/IP???????????????????б??????????????
????–skip_slave_start
?????????????????????????????????????????????START SLAVE???????????????
????–slave_skip_errors=[err_code1??err_code2??… | all]
????????????????????????????????????????????????????????е?????????????????????????SQL??????????κ??????????е??????????????
???????磺
????–slave-skip-errors=1062??1053
????–slave-skip-errors=all
????????????????????????
???????????
????????????????????????????????????????????????????????????????(???SHOW MASTER STATUS????????)?????????????裺
??????????????????????????????ID??? ??????????????????????? ????????????????????????????????????????
????mysql> CHANGE MASTER TO
????-> MASTER_HOST=’master_host_name’??
????-> MASTER_USER=’master_user_name’??
????-> MASTER_PASSWORD=’master_pass’??
????-> MASTER_LOG_FILE=’recorded_log_file_name’??
????-> MASTER_LOG_POS=recorded_log_position;
????4.?????????????START SLAVE???
???????????б????????????????????????????????????????в??趼?????????????????????С?
?????????????
????mysql> FLUSH TABLES WITH READ LOCK?? ????????????и?????????????壩??
????shell> tar zcf /tmp/backup.tar.gz /var/lib/mysql
???????????????????? ????????????????????????????????
????mysql>SHOW MASTER STATUS?? ???????
????mysql> UNLOCK TABLES??
????????????
????????????????????????????????SQL????????沽???е???????????????????????????????????????mysqldump –master-data????????SQL????????????????????????????ж???????????????
???????????
????1.???????????????????????????????????t?????????????????????????
????2.????????????????????????????????????5.1.x?汾????????????????????????????5.1?汾???????????????????д??????м?????????????а???????????????????????????м?????5.1?????
????3.??????????????????????????????????????????????У?????(–default-character-set??–default- collation)?????????????????????????????????????????????????????б?????????????????????????п????????
????4.Q??????????????????????????????
????A????????????????????????崻????????????С????????????????????????????
????5.Q???????????????????????????????±??? ???仰??????????????????????????????????????
????A????????SHOW SLAVE STATUS????Seconds_Behind_Master?е?????
????Q??????????????????????????????????????????
????A????????????裺 ??????????????????Щ???
????mysql> FLUSH TABLES WITH READ LOCK;
????mysql> SHOW MASTER STATUS;
???????SHOW?????????????????????????Щ?????????
????2.???????????????????????????Master_POS_WAIT()?????????????沽???е???????????????
????mysql> SELECT MASTER_POS_WAIT(‘log_name’?? log_offset);
????SELECT????????????????????????????????????????????????????????????????????????
????3.?????????????????????????????????????????????????£?
????mysql> UNLOCK TABLES??
????7.Q???????????????????????????
????A??????????????????????????????????????д???÷???????????????????t?????????????????????????????????????????????????????????????????–skip-innodb??–skip-bdb??–low-priority-updates???–delay-key- write=ALL?????????????????????????????????????????????£????????????????????÷?????MyISAM????????InnoDB?? BDB???
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
???mysql?????????????mysql????? distinct?÷?MySQL?н???????????з??Mysql?????????MySQL Cluster??δ????????????????ν?MySQL??????????300???????MySQL???Uber???????????????????MySql SQL??????????MySQL?????????????????λЧ?????SQL???Java???????:?????MySQL???????linux?°??mysql????MySQL ???????????????????binlog??MySQL????????????Щ??????MySQL???????Mysql???????JDBC?????mysql?????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????