MySQL Master library has data through the lock library

Source: Internet
Author: User
Tags flush

[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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.