MySQL Replication Setup - 4.0.x Preparation: Make sure that server & client have log-bin turned on in my.cnf for mysqld Master should have "server-id=1" and slave should have "server-id=2" Master: - setup a mysql user account for the slave only, and grant only REPLICATION SLAVE prvilege. mysql> GRANT REPLICATION SLAVE ON *.* -> TO 'repl'@'%.mydomain.com' IDENTIFIED BY 'slavepass'; Open a mysql client and leave it open, then flush the logs: mysql> FLUSH TABLES WITH READ LOCK; Create a db dump, and copy it to the slave. # mysqldump --opt database_name > database_export.sql Get the status of the master that you'll use later, and write down the details: mysql > SHOW MASTER STATUS; Unlock the database so it is read-write again: mysql> UNLOCK TABLES; Import the db dump into the slave. # mysql database_name < database_export.sql Slave: Using the data from the master status, run this query: 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; Start slaving: mysql> START SLAVE;