加入收藏 | 设为首页 | 会员中心 | 我要投稿 济南站长网 (https://www.0531zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 系统 > 正文

windows下mysql单向主从同步配置

发布时间:2021-03-06 11:06:36 所属栏目:系统 来源:网络整理
导读:副标题#e# 配置分为两部分,主服务器部分,从服务器部分 本次测试的两台机器的主从同步,环境是windows(linux同理)? 主服务器ip:192.168.1.199 从服务器ip:192.168.1.198 1)主服务器端的配置 找到MySQL的配置文件my.ini文件 在[mysqld]内开启日志功能 log-

查看表

mysql> show tables;
+----------------+
| Tables_in_scrb |
+----------------+
| user           |
+----------------+
1 row in set (0.00 sec)

可以看见,已经成了。

?

到此windows下的单向主从同步配置已经完成了。

如果想关掉主从同步,只需要在从服务端执行一下命令即可

mysql> show slave statusG;
*************************** 1. row ***************************
               Slave_IO_State:
                  Master_Host: 192.168.1.199
                  Master_User: mysync
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000001
          Read_Master_Log_Pos: 1278
               Relay_Log_File: PC05-relay.000003
                Relay_Log_Pos: 663
        Relay_Master_Log_File: mysql-bin.000001
             Slave_IO_Running: No //已经关闭同步复制功能
            Slave_SQL_Running: No
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 1278
              Relay_Log_Space: 1527
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 199
                  Master_UUID: 516cb325-a148-11e9-b3df-02004c4f4f50
             Master_Info_File: C:ProgramDataMySQLMySQL Server 5.7Datamaster.info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State:
           Master_Retry_Count: 86400
                  Master_Bind:
      Last_IO_Error_Timestamp:
     Last_SQL_Error_Timestamp:
               Master_SSL_Crl:
           Master_SSL_Crlpath:
           Retrieved_Gtid_Set:
            Executed_Gtid_Set:
                Auto_Position: 0
         Replicate_Rewrite_DB:
                 Channel_Name:
           Master_TLS_Version:
1 row in set (0.00 sec)

  

?可以对比上边的开始状态,可知已经关闭了。

(编辑:济南站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读