Difference between revisions of "MySQL Replication"
From TCAdmin 2.0 Documentation
(Created page with "== How to Set Up Replication == For detailed instructions read the MySQL reference manual: http://dev.mysql.com/doc/refman/5.1/en/replication-howto.html '''The following instruct...") |
|||
Line 4: | Line 4: | ||
=== MySQL Master Configuration === | === MySQL Master Configuration === | ||
Add the following to your my.ini or my.cnf under '''[mysqld]'''. Then restart the MySQL service. | Add the following to your my.ini or my.cnf under '''[mysqld]'''. Then restart the MySQL service. | ||
− | + | <source lang="bash">log-bin=mysql-bin | |
− | + | server-id=1 | |
− | + | sync_binlog=1</source> | |
=== MySQL Slave Configuration === | === MySQL Slave Configuration === | ||
− | Add the following to your my.ini or my.cnf under '''[mysqld]'''. Replace the | + | Add the following to your my.ini or my.cnf under '''[mysqld]'''. Replace the values as needed. Then restart the MySQL service. |
− | + | <source lang="bash">server-id=2 #each slave should have a unique id. | |
− | + | replicate-do-db=tcadmin2 #enter the name of the TCAdmin database | |
− | + | read-only #set the database read only to prevent accidental writing on the slave.</source> | |
== Configuring TCAdmin == | == Configuring TCAdmin == |
Revision as of 16:31, 19 February 2012
Contents
How to Set Up Replication
For detailed instructions read the MySQL reference manual: http://dev.mysql.com/doc/refman/5.1/en/replication-howto.html The following instructions are provided for your convenience. We do not provide support for configuring replication on your MySQL server.
MySQL Master Configuration
Add the following to your my.ini or my.cnf under [mysqld]. Then restart the MySQL service.
log-bin=mysql-bin server-id=1 sync_binlog=1
MySQL Slave Configuration
Add the following to your my.ini or my.cnf under [mysqld]. Replace the values as needed. Then restart the MySQL service.
server-id=2 #each slave should have a unique id. replicate-do-db=tcadmin2 #enter the name of the TCAdmin database read-only #set the database read only to prevent accidental writing on the slave.