binlog-do-db=zone #需要备份的数据库名,如果备份多个数据库,重复设置这个选项即可
binlog-do-db=zone_main
binlog-do-db=zone_mood
log-slave-updates #这个参数一定要加上,否则不会给更新的记录些到二进制文件里(我没有加,应该是默认就记录到二进制文件里的,待验证)
*************************** 1. row ***************************
File: mysql-bin.000043
Position: 355695
Binlog_Do_DB: zone,zone_credits,zone_main,zone_mood
Binlog_Ignore_DB:
1 row in set (0.00 sec)
#master-user=root
#master-password=111111
#master-port=3306
查看mysql_error.log中的报错信息如下;
110105 13:38:06 mysqld_safe Starting mysqld daemon with databases from /data/mysql_3306/data
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
110105 13:38:06 InnoDB: highest supported file format is Barracuda.
110105 13:38:06 InnoDB Plugin 1.0.6 started; log sequence number 44309
110105 13:38:06 [ERROR] /usr/local/webserver/mysql/libexec/mysqld: unknown variable 'master-host=192.168.7.202'
110105 13:38:06 [ERROR] Aborting
110105 13:38:08 InnoDB: Shutdown completed; log sequence number 44319
110105 13:38:08 [Note] /usr/local/webserver/mysql/libexec/mysqld: Shutdown complete
replicate-do-db=zone_credits
replicate-do-db=zone_main
replicate-do-db=zone_mood
ERROR 1200 (HY000): The server is not configured as slave; fix in config file or with CHANGE MASTER TO,
执行show slave status;又提示Empty set (0.00 sec),想不通问题在哪里
后来发现,原来slave已经默认开启,要先关闭再开启
执行 slave stop;
再执行
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 172.16.1.119
Master_User: zone
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000043
Read_Master_Log_Pos: 355695
Relay_Log_File: mysql_3306-relay-bin.000002
Relay_Log_Pos: 253
Relay_Master_Log_File: mysql-bin.000043
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB: zone,zone_credits,zone_main,zone_mood
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 355695
Relay_Log_Space: 414
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 193300
1 row in set (0.00 sec)
ERROR:
No query specified