[Email protected] [(None)]> grant replication Slave on * * to'Repl'@'192.168.1.177'Identified by'XXX'; Query OK,0Rows Affected (0.01sec)--Global read lock [email protected][(none)]>flush tables with read lock; Query OK,0Rows Affected (0.02sec) [Email protected] [(none)]> Systempwd/data/inst3406--Get master binlog location [email protected][(none)]>Show master status; +--------------------+----------+--------------+------------------+-------------------+ | File | Position | binlog_do_db | binlog_ignore_db | Executed_gtid_set | +--------------------+----------+--------------+------------------+-------------------+ | Inst3406bin.000001|2169| | | | +--------------------+----------+--------------+------------------+-------------------+1RowinchSet (0.00sec)--export instances using mysqldump [email protected][(none)]> System mysqldump-uroot-pxxx-s/tmp/mysql3406.sock--routines--all-databases--opt >alldb.sql [Email protected][(none)]> SystemlsAlldb.sql data3406--unlock [email protected][(none)]>unlock tables; [Email protected] [(none)]>Exit--import dump from vault [[email protected] inst3406]$ MySQL-uroot-pxxx-s/tmp/mysql3506.sock <Alldb.sql--set up information about the main library from the library (host,port, etc.) [[email protected] inst3506]$ mysqls [email protected][(none)]>Change Master tomaster_host='192.168.1.177', Master_user='Repl', master_password='XXX', master_port=3406, master_log_file='inst3406bin.000001', master_log_pos=2169; Query OK,0Rows affected,2Warnings (0.01sec)--start slave [email protected][(none)]> Start slave;
Section from Library
[Email protected] [(None)]> grant replication Slave on * * to'Repl'@'192.168.1.177'Identified by'XXX'; Query OK,0Rows Affected (0.01sec)--Global read lock [email protected][(none)]>flush tables with read lock; Query OK,0Rows Affected (0.02sec) [Email protected] [(none)]> Systempwd/data/inst3406--Get master binlog location [email protected][(none)]>Show master status; +--------------------+----------+--------------+------------------+-------------------+ | File | Position | binlog_do_db | binlog_ignore_db | Executed_gtid_set | +--------------------+----------+--------------+------------------+-------------------+ | Inst3406bin.000001|2169| | | | +--------------------+----------+--------------+------------------+-------------------+1RowinchSet (0.00sec)--export instances using mysqldump [email protected][(none)]> System mysqldump-uroot-pxxx-s/tmp/mysql3406.sock--routines--all-databases--opt >alldb.sql [Email protected][(none)]> SystemlsAlldb.sql data3406--unlock [email protected][(none)]>unlock tables; [Email protected] [(none)]>Exit--import dump from vault [[email protected] inst3406]$ MySQL-uroot-pxxx-s/tmp/mysql3506.sock <Alldb.sql--set up information about the main library from the library (host,port, etc.) [[email protected] inst3506]$ mysqls [email protected][(none)]>Change Master tomaster_host='192.168.1.177', Master_user='Repl', master_password='XXX', master_port=3406, master_log_file='inst3406bin.000001', master_log_pos=2169; Query OK,0Rows affected,2Warnings (0.01sec)--start slave [email protected][(none)]> Start slave;
MySQL Master library has data through the lock library