User Tools

Site Tools


mysqlreplication

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
mysqlreplication [2019/02/19 11:48] z0hpvkmysqlreplication [2025/03/08 22:24] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ===== MySQL Replication ===== ===== MySQL Replication =====
 +
 +<code>
 +192.168.56.102  ubuntu-master
 +192.168.56.103  ubuntu-slave
 +</code>
  
 ==== Set Server ID on Slave ==== ==== Set Server ID on Slave ====
 <code> <code>
 set persist server_id = 2; set persist server_id = 2;
 +
 +service mysql restart
 +systemctl restart mysql
 </code> </code>
-Restart MySQL \\ 
  
 ==== Create Replication User on Master ==== ==== Create Replication User on Master ====
 <code> <code>
-create user 'repl'@'ubuntu-slave' identified by 'ipswich';+create user 'repl'@'ubuntu-slave' identified by 'teapot';
 grant replication slave on *.* to 'repl'@'ubuntu-slave'; grant replication slave on *.* to 'repl'@'ubuntu-slave';
 </code> </code>
Line 40: Line 47:
        ->     MASTER_HOST='ubuntu-master',        ->     MASTER_HOST='ubuntu-master',
        ->     MASTER_USER='repl',        ->     MASTER_USER='repl',
-       ->     MASTER_PASSWORD='welcome123',+       ->     MASTER_PASSWORD='teapot',
        ->     MASTER_LOG_FILE='binlog.000011',        ->     MASTER_LOG_FILE='binlog.000011',
        ->     MASTER_LOG_POS=904;        ->     MASTER_LOG_POS=904;
mysqlreplication.1550576890.txt.gz · Last modified: 2025/03/08 22:23 (external edit)