1 (root@localhost mysql3306.sock)[(none)]>change master to \2 -> master_host='192.168.1.101', \3 -> master_port=3306, \4 -> master_user='replica', \5 -> master_password='replica', \6 -> master_auto_position=1; //As we are using GTID mode to implement replication,this is indispensable.
7 Query OK, 0 rows affected, 2 warnings (0.02sec)8
9 //If you've forgotten the syntax,you can type "help change master to" to know details.
10
11 (root@localhost mysql3306.sock)[(none)]>show warnings;12 +-------+------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
13 | Level | Code | Message |
14 +-------+------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
15 | Note | 1759 | Sending passwords in plain text without SSL/TLS is extremely insecure. |
16 | Note | 1760 | Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. |
17 +-------+------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
18 2 rows in set (0.00sec)19
20 //Ignore these above warnings.
21
22 (root@localhost mysql3306.sock)[(none)]>show slave status\G23 *************************** 1. row ***************************
24 Slave_IO_State:25 Master_Host: 192.168.1.101
26 Master_User: replica27 Master_Port: 3306
28 Connect_Retry: 60
29 Master_Log_File:30 Read_Master_Log_Pos: 4
31 Relay_Log_File: relay-bin.000001
32 Relay_Log_Pos: 4
33 Relay_Master_Log_File:34 Slave_IO_Running: No35 Slave_SQL_Running: No36 Replicate_Do_DB:37 Replicate_Ignore_DB:38 Replicate_Do_Table:39 Replicate_Ignore_Table:40 Replicate_Wild_Do_Table:41 Replicate_Wild_Ignore_Table:42 Last_Errno: 0
43 Last_Error:44 Skip_Counter: 0
45 Exec_Master_Log_Pos: 0
46 Relay_Log_Space: 150
47 Until_Condition: None48 Until_Log_File:49 Until_Log_Pos: 0
50 Master_SSL_Allowed: No51 Master_SSL_CA_File:52 Master_SSL_CA_Path:53 Master_SSL_Cert:54 Master_SSL_Cipher:55 Master_SSL_Key:56 Seconds_Behind_Master: NULL57 Master_SSL_Verify_Server_Cert: No58 Last_IO_Errno: 0
59 Last_IO_Error:60 Last_SQL_Errno: 0
61 Last_SQL_Error:62 Replicate_Ignore_Server_Ids:63 Master_Server_Id: 0
64 Master_UUID: 1b7181ee-6eaf-11e8-998e-080027de0e0e65 Master_Info_File: mysql.slave_master_info66 SQL_Delay: 0
67 SQL_Remaining_Delay: NULL68 Slave_SQL_Running_State:69 Master_Retry_Count: 86400
70 Master_Bind:71 Last_IO_Error_Timestamp:72 Last_SQL_Error_Timestamp:73 Master_SSL_Crl:74 Master_SSL_Crlpath:75 Retrieved_Gtid_Set:76 Executed_Gtid_Set: 1b7181ee-6eaf-11e8-998e-080027de0e0e:1-695013,77 ed142e35-6ed1-11e8-86c6-080027de0e0e:1-17
78 Auto_Position: 1
79 Replicate_Rewrite_DB:80 Channel_Name:81 Master_TLS_Version:82 1 row in set (0.00sec)83
84 //The output shows the details about master info.