标签:style http io ar os 使用 sp strong on
[mysqld] log-bin=mysql-bin server-id=1
innodb_flush_log_at_trx_commit=1
sync_binlog=1
[mysqld] server-id=2
mysql>CREATE USER ‘repl‘@‘%.mydomain.com‘ IDENTIFIED BY ‘slavepass‘;
mysql>GRANT REPLICATION SLAVE ON *.* TO ‘repl‘@‘%.mydomain.com‘;
mysql> FLUSH PRIVILEGES;
mysql> FLUSH TABLES WITH READ LOCK;
mysql > SHOW MASTER STATUS;
+------------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000003 | 73 | test | manual,mysql |
+------------------+----------+--------------+------------------+
mysql> UNLOCK TABLES;
shell> mysqldump -uroot -p --all-databases --master-data > dbdump.db
shell> mysql -uroot -p < dbdump.db
mysql>CHANGE MASTER TO
->MASTER_HOST=‘
->master_host_name
‘,MASTER_USER=‘
->replication_user_name
‘,MASTER_PASSWORD=‘
->replication_password
‘,MASTER_LOG_FILE=‘
->recorded_log_file_name
‘,MASTER_LOG_POS=
recorded_log_position
;
mysql> START SLAVE;
mysql> STOP SLAVE;
标签:style http io ar os 使用 sp strong on
原文地址:http://www.cnblogs.com/java-koma/p/4161680.html