????MySQL?????????????????
???????????? ???????[ 2016/4/7 11:38:06 ] ????????????? MySQL
????????????????MySQL?????????????????????????????????????????????????????????????????????????????????MySQL????????????????????????????????????????????β?????
???????????????????????????????????mysqldump????????????????mysqldump???????????????????????????????????????????????????????????xtrabackup???????????????????xtrabackup??????????????????????????????????????????????????????????и??μ??????????д?????????У???????鵽????????У??????????????????
???????????????
????????192.168.18.212????У?
???????1??192.168.18.213????У?
???????2??192.168.18.214????????
?????????汾??MySQL5.5
?????洢???棺Innodb
?????????????weibo
???????mysqldump???
????MySQL?????????binlog??????????????????????????binlog??????????????????????binlog??????????????????????????????
??????????????ò??????£?
????# vi my.cnf
????server-id = 1 #id?
????log-bin = mysql-bin #????binlog???
????auto-increment-increment = 1 #??Ubuntu????MySQL5.5???????????1
????auto-increment-offset = 1
????slave-skip-errors = all #??????????????????
????1. ????????????
????mysql> grant all on *.* to 'sync'@'192.168.18.%' identified by 'sync';
????2. ???????MySQL
????# vi my.cnf
????server-id = 3 #???????3
????log-bin = mysql-bin #????binlog???
????auto-increment-increment = 1 #????????????Ubuntu????MySQL5.5???????????1
????auto-increment-offset = 1
????slave-skip-errors = all #??????????????????
????3. ????????
????# mysqldump -uroot -p123 --routines --single_transaction --master-data=2 --databases weibo > weibo.sql
?????????????
????–routines???????洢????????
????–single_transaction???????????????????????????????????????????????unlock tables;??lock-tables????????????д?????????dump????
????–master-data????????1????dump?????change master to??binlog???pos?д??????У?????2???change master toд??????в?????
????4. ?????????????
????# scp weibo.sql root@192.168.18.214:/home/root
????5. ????????test_tb????????????????????weibo.sql????е?
????mysql> create table test_tb(id int??name varchar(30));
????6. ????????
????# mysql -uroot -p123 -e 'create database weibo;'
????# mysql -uroot -p123 weibo < weibo.sql
??????
???·???
??????????????????
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