2016-06-13 67 views
0

有人可以一步一步地寫我如何進行多源複製。我讀了很多關於它的信息,但我有一個gtid模式的問題。我在主計算機上的my.ini文件中啓用了gtid-mode,但是當我在數據庫上進行轉儲時,出現了與執行gtid有關的錯誤,需要將其清空。MySQL多源複製

+0

您能否將您的錯誤完整地發佈到您的'my.ini'文件中。 –

回答

0

10:53:52恢復C:\ Users \ KasiSTD \ Desktop \ master3-1.sql運行:mysql.exe --defaults-file =「c:\ users \ kasistd \ appdata \ local \ temp \ tmpmw0avv .cnf「--protocol = tcp --host = localhost --user = root --port = 3306 --default-character-set = utf8 --comments <」C:\ Users \ KasiSTD \ Desktop \ master3-1。 sql「錯誤1840(HY000)在第26行:@@ GLOBAL.GTID_PURGED只能在@@ GLOBAL.GTID_EXECUTED爲空時設置。操作失敗,退出代碼1 10:53:53導入C:\ Users \ KasiSTD \ Desktop \ master3-1.sql已經完成1錯誤

這是從MySQL服務器5.7錯誤,當我嘗試導入備份文件

這是my.ini文件只在[mysqld]中更改log-bin = mysql-bin binlog-do-db = master3 auto_increment_increment = 2 gtid-mode = on enforce-gtid-consistency = 1 Server Id server-id = 4

+0

在加載轉儲文件之前在從屬設備上執行RESET MASTER。 – malyy

0

嘗試執行:通道

slave> reset master; 
slave> source dump.sql; 
slave> start slave; 
slave> show slave statusG 
[...] 
Slave_IO_Running: Yes 
Slave_SQL_Running: Yes 
[...] 
+0

當我嘗試打開源時出現錯誤:文件'\ mysql \ gtid_executed.frm'中的信息不正確 –

+0

我不知道使用gtid_executed gtid_purged以及如何設置Retrieved_Gtid_SET: –

+0

您確定需要gtid-模式啓用? – malyy

0

的MySQL>顯示從屬狀態'master-joro'\ G *************************** 1. row ************ *************** Slave_IO_State:連接掌握 MASTER_HOST:192.168.1.62 MASTER_USER:joro MASTER_PORT:3306 Connect_Retry:60 MASTER_LOG_FILE:MySQL的-bin.000003 Read_Master_Log_Pos: 1066 RELAY_LOG_FILE:[email protected] RELAY_LOG_POS:4 Relay_Master_Log_File的:mysql-bin.000003 Slave_IO_Running:連接 Slave_SQL_Running:是 Replicate_Do_DB:ID,master2,final_repl 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:1066 Relay_Log_Space:154 Until_Condition:無 Until_Log_File: Until_Log_Pos:0 Master_SSL_Allowed:否 Master_SSL_CA_File : Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: 的Seconds_Behind_Master:NULL Master_SSL_Verify_Server_Cert:沒有 Last_IO_Errno:0 Last_IO_Error: Last_SQL_Errno:0 Last_SQL_Error: Replicate_Ignore_Server_Ids: Master_Server_Id:0 Master_UUID: Master_Info_File:MySQL的。slave_master_info SQL_Delay:0 SQL_Remaining_Delay:NULL Slave_SQL_Running_State:從站已讀取所有中繼日誌;等待多了起來 日期 Master_Retry_Count:86400 Master_Bind: Last_IO_Error_Timestamp: Last_SQL_Error_Timestamp: Master_SSL_Crl: Master_SSL_Crlpath: Retrieved_Gtid_Set: Executed_Gtid_Set:2069dbc8-2c85-11e6-b4ce-0027136c5f75:1 Auto_Position:0 Replicate_Rewrite_DB: Channel_Name:master-joro Master_TLS_Version: set in set(0.00 sec)