MySQL 5.1 Replication

To configure data replication between 2 MySQL system, we can follow MySQL 5.1 Replication HOWTO document. If the master system is a current production database system, we should stop and copy database files on /var/lib/mysql to new system, and follow documentation to modify the MySQL config files.

[mysqld]
log-bin=mysql-bin
server-id=1

For InnoDB:
[mysqld]
sync_binlog=1
[innodb]
innodb_flush_log_at_trx_commit=1

On the slave system, we can follow slave base config documentation to do the configuration, and restore database files copied from existing system to local /var/lib/mysql/ directory.

[mysqld]
server-id=2

About Sammy Fung

Sammy Fung 是熱情的 IT 技術領袖和演講者,擁有開源軟件、開放數據、Python 方面的深厚專業知識。目前作為開發者關係專業人士,推動開發者參與和倡導,通過有影響力的舉措促進充滿活力的技術社區並賦能開發者。