In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces how to solve the problem of error code: 1032 in MySQL. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.
Check the solution online first stop slave, and then from the new change master to the wrong location. And then start slave
=
Stop slave
CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000521', MASTER_LOG_POS=869528465
Start slave
Show slave status
=
When this kind of problem occurs, it is judged to be the problem of master-slave synchronization inconsistency. Percona-toolkit is recommended.
Here are the experimental steps.
Experimental environment:
Master:192.168.162.168
Slave:192.168.162.167
Operation
Master:
MariaDB [test] > create table test (id int (10), name varchar (20), city varchar (30))
MariaDB [test] > insert into test (id,name,city) values (1), (2) (2) (2), (3) (3)
Slave:
MariaDB [test] > select * from test
+-+
| | id | name | city | |
+-+
| | 1 | aaa | aaa |
| | 2 | bbb | bbb |
| | 3 | ccc | ccc |
+-+
MariaDB [test] > delete from test where id = 1
Master:
Update test set name='abb' where id=1
Slave: an error is reported as shown below:
Method 1:
MariaDB [test] > stop slave; MariaDB [test] > CHANGE MASTER TO MASTER_HOST='192.168.162.168',MASTER_USER='repl',MASTER_PASSWORD='123456',MASTER_PORT=3306,MASTER_LOG_FILE='mysql-bin.000646',MASTER_LOG_POS=1801;MariaDB [test] > start slave
However, the surface of the query data is consistent with the master and slave, but in fact it is still poor data.
Master:
Slave:
Method 2:
Environmental preparation:
Solution: use the powerful Swiss percona-toolkit tool 'pt-table-checksum','pt-table-sync'
Note: both tools are executed on Master.
Master:
Pt-table-checksum-nocheck-replication-filters-databases=test-replicate=test.checksums-create-replicate-table-no-check-binlog-format-host=192.168.162.168-port 3306-uyang-p123456
-- host=master_ip
-- port mysql port
-- databases=test problem database
-- replicate= creates a table on Master's test library that records problems with master-slave synchronization
-- create-replicate-table
-- no-check-binlog-format does not check the replicated binlog mode. If the binlog mode is ROW, an error will be reported.
-- nocheck-replication-filters does not check the replication filter. It is recommended to enable it. Later, you can use-- databases to specify the database to be checked.
When the master and slave are out of sync, use the tool 'pt-table-checksum': directly
It is suggested that master-slave synchronization has stopped, waiting for master-slave synchronization to be turned on.
Use the 'pt-table-sync' tool:
Still indicates that master-slave synchronization is turned off.
So let's turn it on and learn from method 1 to turn on master-slave synchronization.
Slave:
Well, the master and the follower are still inconsistent.
Now use the pt tool to solve it.
Master:
The target came out, and the master-slave synchronization was found to be inconsistent and recorded in the table.
Master:
Pt-table-sync-- replicate=test.checksums-- databases=test hobby 192.168.162.168pamphlet 123456 execute 192.168.162.162.167pamphlet 123456-- printpt-table-sync-- replicate=test.checksums-- databases=test hype 192.168.162.162.168-- databases=test hype 192.168.162.168
Problem solved!
On how to solve the error code in MySQL: 1032 of the problem is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.