mysql:recoveringsynchronization
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
mysql:recoveringsynchronization [2017/11/11 12:23] – [Sixth step: issue a change master to command in the slave] rlunaro | mysql:recoveringsynchronization [2022/12/02 21:02] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 6: | Line 6: | ||
I've decided to recover it by //the hard way//: deleting all the information in the slave and | I've decided to recover it by //the hard way//: deleting all the information in the slave and | ||
starting with a fresh copy of the master. | starting with a fresh copy of the master. | ||
+ | |||
+ | ===== Zero step: stop the slave ===== | ||
+ | |||
+ | <WRAP left round info 20%> | ||
+ | Do this in the slave | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | mysql> stop slave; | ||
+ | -- disable the slow query log is necessary because | ||
+ | -- in the event of a full restore, the logging tables | ||
+ | -- are dropped | ||
+ | mysql> SET GLOBAL slow_query_log=0; | ||
+ | mysql> set global general_log=0; | ||
+ | </ | ||
===== First step: change password for all clients ===== | ===== First step: change password for all clients ===== | ||
Line 13: | Line 28: | ||
actual passwords, just issue this command and copy all the results of the table: | actual passwords, just issue this command and copy all the results of the table: | ||
- | < | + | < |
Do this in the MASTER | Do this in the MASTER | ||
</ | </ | ||
Line 33: | Line 48: | ||
Then, change the password for all your users to a new password: this will | Then, change the password for all your users to a new password: this will | ||
- | ban everyone from the server: | + | ban everyone from the server: |
+ | |||
+ | <WRAP left round important 20%> | ||
+ | Do this in the MASTER | ||
+ | </ | ||
< | < | ||
Line 58: | Line 77: | ||
again in the server (except you). In windows: | again in the server (except you). In windows: | ||
- | < | + | < |
Do this in the master | Do this in the master | ||
</ | </ | ||
Line 82: | Line 101: | ||
</ | </ | ||
- | Annotate these " | + | Annotate these " |
==== Fourth step: make a full backup of your database ==== | ==== Fourth step: make a full backup of your database ==== | ||
- | < | + | < |
Do this in the master | Do this in the master | ||
</ | </ | ||
Line 103: | Line 122: | ||
==== Fifth step: recover in the slave database ==== | ==== Fifth step: recover in the slave database ==== | ||
- | < | + | < |
Do this in the slave | Do this in the slave | ||
</ | </ | ||
Line 115: | Line 134: | ||
For the replication it is a common place to have a user for this task. In my case is the '' | For the replication it is a common place to have a user for this task. In my case is the '' | ||
- | < | + | < |
- | Do this in the master | + | Do this in the slave |
+ | </ | ||
+ | <WRAP left round important | ||
+ | Do this in the slave | ||
</ | </ | ||
- | |||
< | < | ||
update mysql.user set password = ' | update mysql.user set password = ' | ||
Line 129: | Line 150: | ||
On the slave, issue the following command: | On the slave, issue the following command: | ||
- | < | + | < |
Do this in the slave | Do this in the slave | ||
</ | </ | ||
Line 140: | Line 161: | ||
master_port = 3306, | master_port = 3306, | ||
master_log_file = 'you have to guess the log file name that goes here from the slave', | master_log_file = 'you have to guess the log file name that goes here from the slave', | ||
- | master_log_pos = 4; | + | master_log_pos = ENTER THE POSITION YOU ANNOTATE IN THE LAST COMMAND; |
+ | </ | ||
+ | And start the slave: | ||
+ | |||
+ | <WRAP left round info 20%> | ||
+ | Do this in the slave | ||
+ | </ | ||
+ | < | ||
+ | start slave; | ||
+ | mysql> SET GLOBAL slow_query_log=1; | ||
+ | mysql> set global general_log=1; | ||
</ | </ | ||
mysql/recoveringsynchronization.1510402997.txt.gz · Last modified: 2022/12/02 21:02 (external edit)