Setting up mysql replication

On the primary DB node: Enable binary logging in my.cnf: [mysqld] log_bin=mysql-bin server-id=1 Restart MySQL /etc/init.d/mysqld restart Create a user for replication: mysql> GRANT REPLICATION SLAVE ON *.* TO 'user'@'1.2.3.4' IDENTIFIED BY 'slavepass'; Find filename of binlog: mysql> show master status; Do the mysqldump of the database you want to replicate: mysqldump -c –create-options -u root -ppassword –lock-tables databasename > dump.sql Copy the sql file over to the slave: scp dump....

November 24, 2010 · Ed Randall