To set up a master/slave database, perform the following steps from the command line.
- The first step is to determine which address the MySQL server is bound to. To do this, locate the line of the MySQL configuration file that contains the bind-address parameter:
bind-address = 127.0.0.1
This IP address will be set to whichever IP address the master server uses.
- Next, uncomment the line of the MySQL configuration file that contains the
server-id, which is most probably located at
- The Unix
sedcommand can perform this easily:
$ sed -i s/#server-id/server-id/g /etc/mysql/my.cnf
/etc/mysql/my.cnfstring will need to be substituted with the correct filename