- 主數據庫MySQL數據庫服務器2012
- 從數據庫MySQL的Win7的XAMPP
- DB大小500MB
- 表計42
我已經安裝了複製成功但它上週停止,我的奴隸顯示錯誤Slave_SQL_Running No
。我意識到它正在查看一個不正確的日誌文件(00004,而應該是00006)。複製不更新所有表
我已經排序了;
在MASTER;
SHOW MASTER STATUS;
Copied the values of MASTER_LOG_FILE and MASTER_LOG_POS.
在SLAVE;
STOP SLAVE;
RESET SLAVE;
CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=98; (<- example values)
START SLAVE;
SHOW SLAVE STATUS \G;
在我的主人我通過編輯表members
測試的複製 - I編輯的行值中的一個(從85
到86
- 這成功地複製在我的從站)。但我注意到,在我的主人members
表中有70652個成員,但在我的奴隸只有70056.
我添加了兩個新成員到我的主成員表中,並且兩個表上的總數增加了2。但似乎仍有600人失蹤?
可能是什麼問題?複製似乎正在工作,但總數不是。新成員每天都會添加到members表中,但不會添加到我的slave成員表中。
我的奴隸狀態表(來自phpmyadmin)的結果是;
Slave_IO_State Waiting for master to send event
Master_Host xxx.xxx.xxx.xxx
Master_User repl
Master_Port 3306
Connect_Retry 60
Master_Log_File mysql-bin.000006
Read_Master_Log_Pos 787956776
Relay_Log_File mysql-relay-bin.000004
Relay_Log_Pos 624412
Relay_Master_Log_File mysql-bin.000006
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
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 787956776
Relay_Log_Space 788197
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
還有別的東西,我可以檢查或測試?
感謝@Bernd Buffen會你推薦percona工具包?我從來沒聽說過!在這裏很新的dba。謝謝你的答案順便說一句,我認爲你是對的。 –
簡單的方法是將主數據庫轉儲爲**/usr/local/mysql/bin/mysqldump -R --master-data --single-transaction --all-databases -uroot -pxxxxx> db.sql **並將它們導入從機。在文件中是一個** CHANGE MASTER TO MASTER_LOG_FILE ='binlog.000099',MASTER_LOG_POS = 99999; **設置主站 –