国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > MySQL > 正文

Windows mysql 雙向同步設置方法 詳細篇

2024-07-24 13:03:15
字體:
來源:轉載
供稿:網友
1.1         環境搭建1.2         創建同步帳戶

A節點操作:

mysql>flush privileges;

B節點操作步驟如上,權限賦予如下:

mysql>flush privileges;

1.3         配置數據同步選項1.3.1    A主機操作

log-bin=mysql-bin #同步事件的日志記錄文件

binlog-do-db=ikey_db #提供數據同步服務的數據庫日志

binlog-do-db=ikey_log #提供數據同步服務的數據庫日志

####同步的數據庫

replicate-do-db=ikey_log  #同步的數據庫

1.3.2    B主機操作1.3.3    驗證數據同步

mysql> show master status;

+------------------+----------+------------------+------------------+

| File             | Position | Binlog_Do_DB     | Binlog_Ignore_DB |

+------------------+----------+------------------+------------------+

| mysql-bin.000001 |       98 | ikey_db,ikey_log |                  |

+------------------+----------+------------------+------------------+

1 row in set (0.00 sec)

mysql> show slave status/G;

*************************** 1. row ***************************

             Slave_IO_State: Waiting for master to send event

                Master_Host: 192.168.1.101

                Master_User: ym

                Master_Port: 3306

              Connect_Retry: 60

            Master_Log_File: mysql-bin.000001

        Read_Master_Log_Pos: 98

             Relay_Log_File: testBBB-relay-bin.000002

              Relay_Log_Pos: 235

      Relay_Master_Log_File: mysql-bin.000001

           Slave_IO_Running: Yes

          Slave_SQL_Running: Yes

            Replicate_Do_DB: ikey_db,ikey_log

 

1.4         同步維護1.4.1  A節點:

mysql> show master status;

+------------------+----------+------------------+------------------+

| File             | Position | Binlog_Do_DB     | Binlog_Ignore_DB |

+------------------+----------+------------------+------------------+

| mysql-bin.000002 |       118 | ikey_db,ikey_log |                  |

+------------------+----------+------------------+------------------+

1 row in set (0.00 sec)

1.4.2  B節點:

A方向同步的帳戶權限

mysql>drop user ym@192.168.1.101;

mysql>flush privileges;

mysql>grant replication slave on *.* to ym@192.168.1.103 identified by 'ym';

mysql>flush privileges;

B方向同步配置項:

mysql>CHANGE MASTER TO

    -> MASTER_HOST='192.168.1.103',   # Master服務器地址

    -> MASTER_USER='ym',

Query OK, 0 rows affected (0.02 sec)

mysql> show master status;

+------------------+----------+------------------+------------------+

| File             | Position | Binlog_Do_DB     | Binlog_Ignore_DB |

+------------------+----------+------------------+------------------+

| mysql-bin.000003 |       98 | ikey_db,ikey_log |                  |

+------------------+----------+------------------+------------------+

1 row in set (0.00 sec)

 

1.4.3  接著A節點:

A方向同步配置項:

mysql>CHANGE MASTER TO

Query OK, 0 rows affected (0.02 sec)

 

           Slave_IO_Running: Yes

          Slave_SQL_Running: Yes

即處于正常同步狀態。

 

 [j1]執行同步權限的用戶

 [j3]同步帳戶密碼

 [j4]執行同步權限的用戶

 [j6]同步帳戶密碼

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 康平县| 修武县| 武安市| 桑植县| 泰安市| 绥芬河市| 武穴市| 红桥区| 施秉县| 同德县| 梅州市| 宁城县| 伊吾县| 平凉市| 桂平市| 湄潭县| 上饶县| 东乌珠穆沁旗| 荆门市| 西吉县| 聊城市| 拉萨市| 昌邑市| 加查县| 巴里| 北海市| 应用必备| 治多县| 十堰市| 高阳县| 榆中县| 满洲里市| 息烽县| 任丘市| 靖西县| 鸡泽县| 石渠县| 彰武县| 正蓝旗| 德格县| 岢岚县|