MySQL Database Replication: =========================== 1.) Configure Master -------------------- On "Replication" Tab in MySQL Administrator GUI: - Server Id - Master hostname - Master Username On "Log files" Tab in MySQL Administrator GUI: - Binary Logfile Name 2.) Configure Slave ------------------- On "Replication" Tab in MySQL Administrator GUI: - Server Id - Do not start slave automaticaly => check "Relay Log" Section: configure relay log files 3.) Lock Master Database and Record Current Position ---------------------------------------------------- shell> mysql --user=username --password=password mysql> FLUSH TABLES WITH READ LOCK; mysql> SHOW MASTER STATUS; +---------------+----------+--------------+------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | +---------------+----------+--------------+------------------+ | mysql-bin.003 | 73 | test | manual,mysql | +---------------+----------+--------------+------------------+ File: Name of the log Position: Offset within that log (If binary logging was not enabled on master server before, the above will be empty. Use empty string ('') instead.) ! Important: ! Don't quit this session until the database dump (see point 4) is completed! Quitting this session will free the lock and the dumped data will be inconsistent. 4.) Dump Master Database ------------------------ shell> mysqldump --user=username --password=password --all-databases --lock-all-tables > dbdump.db Now you can quit the session of point 3. 5.) Import Master DB Dump on Slave ---------------------------------- shell> mysql < fulldb.dump 6.) Start Replication on Slave ------------------------------ mysql> CHANGE MASTER TO -> MASTER_HOST='master_host_name', -> MASTER_USER='replication_user_name', -> MASTER_PASSWORD='replication_password', -> MASTER_LOG_FILE='recorded_log_file_name', -> MASTER_LOG_POS=recorded_log_position; mysql> start slave; - Uncheck "Do not start slave automaticaly" - Optionally restart DB Server Service to check for any errors or warnings on startup