530 Part V . Advanced Performance A basic

530 Part V . Advanced Performance A basic replication configuration Only a few options are necessary to configure a basic replication set between a master and slave in MySQL. This section examines those configuration settings. I am assuming that you ve read the section on planning and preparing for replication and have MySQL running with the same version on the participating hosts. First, you must add a user to the master server. This user serves to communicate from the slaves to the master for replication. I strongly recommend that you create a separate user for replication and grant that user only the minimum privilege necessary, the FILEprivilege. Consider this example: GRANT FILE ON *.* TO replicateuser@replicatehost IDENTIFIED BY
; Figure 18-1 illustrates this statement being executed on the server to be the master in the replication system. Remember, no need to issue a FLUSH PRIVILEGES statement when using a GRANT statement. Figure 18-1: Adding the replication user account On the master inside the MySQL configuration file, usually my.cnf or my.ini, add the following two lines to the [mysqld] section: log-bin server-id=1 The log-bin option turns on the binary log that tracks updates, the server-id option is a unique value for the replication partner in this set. The server-idvalue that you set must be unique across all partners in the replication set. For example, you cannot have two server IDs of 1 taking part in the same replication. If you have existing data in a database, you should take a snapshot of that data prior to starting replication. Create a .taror .zipfile with the database or
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.

Leave a Reply