From bca0025c34ce16f5c29429ecd6407245c7e41261 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 22 Dec 2011 04:51:41 +0100 Subject: Improve MySQL replication setup documentation --- fripost-docs.org | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/fripost-docs.org b/fripost-docs.org index f15810f..7dba190 100644 --- a/fripost-docs.org +++ b/fripost-docs.org @@ -495,7 +495,7 @@ mysql -u root -p # Create mail user - CREATE USER 'mail'@'localhost' IDENTIFIED BY 'mijhl9hniiMu5WxvvtdgsacxZ'; + CREATE USER 'mail'@'localhost' IDENTIFIED BY ''; GRANT SELECT ON mail.alias TO 'mail'@'localhost'; GRANT SELECT ON mail.domain TO 'mail'@'localhost'; GRANT SELECT ON mail.mailbox TO 'mail'@'localhost'; @@ -521,6 +521,13 @@ These instructions are mainly adapted from the MySQL manual. /etc/init.d/mysql restart +# Enter MySQL shell and create a user with replication privileges. +# NB: Use only ASCII for the +mysql -u root -p + + GRANT REPLICATION SLAVE ON *.* TO 'slave_user'@'localhost' IDENTIFIED BY ''; + FLUSH PRIVILEGES; + ***** Configure the slave ****** Set up an SSH tunnel @@ -528,17 +535,13 @@ We begin by setting up an SSH tunnel from the slave to the master, as described ****** Preparing steps to take on master -# Enter MySQL shell and create a user with replication privileges. -# NB: Use only ASCII for the +# Make a database dump. + mysql -u root -p - GRANT REPLICATION SLAVE ON *.* TO 'slave_user'@'localhost' IDENTIFIED BY ''; - FLUSH PRIVILEGES; USE mail; FLUSH TABLES WITH READ LOCK; quit; - -# Make a database dump. mysqldump -u root -p --opt mail > mydump.sql @@ -568,7 +571,7 @@ sudo chmod 0750 $TMP_DIR server-id = 2 relay-log = mysqld-relay-bin -/etc/init.d/mysql restart +sudo service mysql restart # Enter the MySQL shell and create the database: -- cgit v1.2.3