MySQL
Dumping current GRANTs
Note that you need to run this as a user with sufficient rights to select from mysql.user and to then run show grants:
mysql -B -N -e "SELECT DISTINCT CONCAT('SHOW GRANTS FOR ''',user,'''@''',host,''';') AS query FROM user" mysql | mysql
Setting up replication
Basically this list:
With a shorter list of steps if starting afresh with new master and slave:
To turn on compression of replicated data the slave_compressed_protocol can be set on the slave (replication needs to be restarted for this change to take effect). The master and slave need to support compression (see have_compress):
mysql> show variables like '%compress%'; +---------------------------+-------+ | Variable_name | Value | +---------------------------+-------+ | have_compress | YES | | slave_compressed_protocol | ON | +---------------------------+-------+ 2 rows in set (0.01 sec)
The database(s) replicated can be changed by one (or both) of these startup options:
On the master: binlog_do_db (but note this means the binary logs will be missing data, so cannot be used for restoring after a failure)
(http://dev.mysql.com/doc/refman/5.0/en/replication-options-binary-log.html#option_mysqld_binlog-do-db)On the slave: replicate-do-db
(http://dev.mysql.com/doc/refman/5.0/en/replication-options-slave.html#option_mysqld_replicate-do-db)