Translator: ye Jinrong (Email: I will not talk about unnecessary nonsense, and I will start to practice it directly. the mysql versions used in this test are 4.1.7-standard-log, the master operating system is redhat9.0, And the slave operating system is redhat7.3.1. modify my on the master. cnf, add configuration parameters: [mysqld] log-binserver-id12.
Translator: ye Jinrong (Email: I will not talk about unnecessary nonsense, and I will start to practice it directly. the mysql versions used in this test are 4.1.7-standard-log, the master operating system is redhat 9.0, And the slave operating system is redhat 7.3. 1. modify my. cnf, add the configuration parameter: [mysqld] log-bin server-id = 1 2.
Translator: ye Jinrong (Email:
If you don't talk nonsense about it, you can get started.
The mysql versions used in this test are 4.1.7-standard-log, the master operating system is redhat 9.0, And the slave operating system is redhat 7.3.
1. modify my. cnf on the master end and add the configuration parameters:
[Mysqld]
Log-bin
Server-id = 1
2. modify my. cnf on the slave side and add the configuration parameters:
Log-bin
Master-host = master
Master-user = rep
Master-password = rep
Master-port = 3306
Server-id = 2
The above parameters are the most basic configuration, so I will not explain them much. I will undo it to initialize the data.
1. Clear all binlogs on the master. If the existing binlogs are useful, back up them first. Then, pack all data files on the master, including ibdata files.
2. For a similar holiday, clear all binlogs on the slave and copy the data file compressed package on the master to its own data file directory.
Start master and add a rep user, "grant all privileges on *. * to rep @ % identified by 'rep '; flush privileges ;".
Start slave and check whether the synchronization is successful.
Generally, the reason for the failure is that the binlog fails to be located after the slave connects to the master. Therefore, you need to set the binlogs of both parties to be consistent, and then stop slave; start slave.