請教各位大佬,搭建了一套mysql主從,主庫中建表,插入資料,主庫中Position不增長,導致從庫也同步不過去,這是什么情況?忘各位大佬不吝賜教!
mysql> show master status\G
*************************** 1. row ***************************
File: mysql-bin.000005
Position: 590
Binlog_Do_DB: btbzb_zmhk,test
Binlog_Ignore_DB: mysql,information_schema,performance_schema
Executed_Gtid_Set:
1 row in set (0.00 sec)
mysql>
mysql> insert into test.employee (name,phone) values ('zm',18888888888);
Query OK, 1 row affected (0.06 sec)
mysql> insert into test.employee (name,phone) values ('zm',18888888888);
Query OK, 1 row affected (0.04 sec)
mysql> insert into test.employee (name,phone) values ('zm',18888888888);
Query OK, 1 row affected (0.09 sec)
mysql> insert into test.employee (name,phone) values ('zm',18888888888);
Query OK, 1 row affected (0.02 sec)
mysql> insert into test.employee (name,phone) values ('zm',18888888888);
Query OK, 1 row affected (0.03 sec)
mysql> show master status\G
*************************** 1. row ***************************
File: mysql-bin.000005
Position: 590
Binlog_Do_DB: btbzb_zmhk,test
Binlog_Ignore_DB: mysql,information_schema,performance_schema
Executed_Gtid_Set:
1 row in set (0.00 sec)
mysql>
uj5u.com熱心網友回復:
從庫狀態正常,如下mysql> show slave status \G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.16.144
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000005
Read_Master_Log_Pos: 590
Relay_Log_File: relay-log-bin.000002
Relay_Log_Pos: 320
Relay_Master_Log_File: mysql-bin.000005
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: 590
Relay_Log_Space: 525
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: 144
Master_UUID: 03756dc9-83fe-11e8-8572-107b44f32217
Master_Info_File: /www/server/data/master.info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
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:
Auto_Position: 0
Replicate_Rewrite_DB:
Channel_Name:
Master_TLS_Version:
1 row in set (0.00 sec)
uj5u.com熱心網友回復:
Replicate_Do_DB:Replicate_Wild_Do_Table:
為空,改下組態檔,設定庫
uj5u.com熱心網友回復:
主庫的配置以及改了,從庫這個引數應該還需要加嗎?
uj5u.com熱心網友回復:
主庫不加,是你沒開 log_bin 吧,看看這個查詢的結果是什么show variables like '%log_bin';
uj5u.com熱心網友回復:
主庫肯定開了的,昨天后來把 binlog-do-db這個引數注釋掉,重要增加了,然而不明白為什么會這樣mysql> show variables like '%log_bin';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| log_bin | ON |
| sql_log_bin | ON |
+---------------+-------+
2 rows in set (0.01 sec)
uj5u.com熱心網友回復:
那估計是你配置得有問題這個引數決定那些庫要記錄 binlog,如果配置錯了,那沒有配置上的庫自然是不記錄 binlog 的
如果 所有庫都要同步,那通常不設定這個,默認是所有庫都要記錄的(有需要可以考慮通過設定 Binlog_Ignore_DB 把系統庫過濾掉)
一般做主備就不做設定,這樣系統庫的也過去,這樣保持兩邊完全一樣,主庫掛了就直接高性用從庫就行
uj5u.com熱心網友回復:
https://blog.csdn.net/fsdf8sad7/article/details/88844412轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/66840.html
標籤:MySQL
上一篇:Mysql 保存float陣列
