MySQL provides the replication tool. We later called this tool the native MySQL replication. To setup this replication, follow the steps as follows:
Step 1: Assigning Unique ID for MySQL Servers
You need to update the server-id setup in the configuration file and restart the MySQL database. You can check the server-id with the following command:
Step 1: Assigning Unique ID for MySQL Servers
You need to update the server-id setup in the configuration file and restart the MySQL database. You can check the server-id with the following command:
mysql> show variables like '%server_id%'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | server_id | 2 | +---------------+-------+ 1 row in set (0.00 sec)
Step 2: Enabling the binary logging on the master server.
Please refer to How to enable binary logging for MySQL?
Step 3: Creating account on Master for Slave to connect to.
An example command is shown as follows:
Please refer to How to enable binary logging for MySQL?
Step 3: Creating account on Master for Slave to connect to.
An example command is shown as follows:
mysql> create user 'slave_user'@slc03rqi identified by 'slave_user'; Query OK, 0 rows affected (0.01 sec) mysql> grant replication slave on *.* to 'slave_user'@slc03rqi; Query OK, 0 rows affected (0.00 sec)