User Tools

Site Tools


mysql:recoveringsynchronization

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
mysql:recoveringsynchronization [2017/11/11 13:32] – [Zero step: stop the slave] rlunaromysql:recoveringsynchronization [2017/11/11 17:03] – [Sixth step: issue a change master to command in the slave] rlunaro
Line 9: Line 9:
 ===== Zero step: stop the slave ===== ===== Zero step: stop the slave =====
  
-<WRAP right round info 40%>+<WRAP left round info 20%>
 Do this in the slave Do this in the slave
 </WRAP> </WRAP>
Line 15: Line 15:
 <code> <code>
 mysql> stop 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;
 </code> </code>
  
Line 23: 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:
  
-<WRAP center round important 60%>+<WRAP left round important 20%>
 Do this in the MASTER Do this in the MASTER
 </WRAP> </WRAP>
Line 43: 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 
 +</WRAP>
  
 <code> <code>
Line 68: Line 77:
 again in the server (except you). In windows:  again in the server (except you). In windows: 
  
-<WRAP center round important 60%>+<WRAP left round important 20%>
 Do this in the master Do this in the master
 </WRAP> </WRAP>
Line 92: Line 101:
 </code> </code>
  
-Annotate these "File" and "position": it will be neede futher. +Annotate these "File" and "position": it will be needed futher. 
  
 ==== Fourth step: make a full backup of your database ==== ==== Fourth step: make a full backup of your database ====
  
  
-<WRAP center round important 60%>+<WRAP left round important 20%>
 Do this in the master Do this in the master
 </WRAP> </WRAP>
Line 113: Line 122:
 ==== Fifth step: recover in the slave database ==== ==== Fifth step: recover in the slave database ====
  
-<WRAP center round help 60%>+<WRAP left round help 20%>
 Do this in the slave Do this in the slave
 </WRAP> </WRAP>
Line 125: Line 134:
 For the replication it is a common place to have a user for this task. In my case is the ''repl'' user. Because I've changed the password in the first steps, I have to set the original password back now.  For the replication it is a common place to have a user for this task. In my case is the ''repl'' user. Because I've changed the password in the first steps, I have to set the original password back now. 
  
-<WRAP center round important 60%> +<WRAP left round info 20%> 
-Do this in the master+Do this in the slave 
 +</WRAP> 
 +<WRAP left round important 20%> 
 +Do this in the slave
 </WRAP> </WRAP>
- 
 <code> <code>
 update mysql.user set password = '*xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' where user = 'repl'; update mysql.user set password = '*xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' where user = 'repl';
Line 139: Line 150:
 On the slave, issue the following command:  On the slave, issue the following command: 
  
-<WRAP center round info 60%>+<WRAP left round info 20%>
 Do this in the slave Do this in the slave
 </WRAP> </WRAP>
Line 150: 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;  -- everybody put 4 here, I don't know why +master_log_pos = ENTER THE POSITION YOU ANNOTATE IN THE LAST COMMAND;   
 +</code>
  
 +And start the slave: 
 +
 +<WRAP left round info 20%>
 +Do this in the slave
 +</WRAP>
 +<code>
 +start slave;
 +mysql> SET GLOBAL slow_query_log=1; 
 +mysql> set global general_log=1;
 </code> </code>
  
  
mysql/recoveringsynchronization.txt · Last modified: 2022/12/02 22:02 by 127.0.0.1