Mysql:如何在使用复制脱机后同步数据库?

bel*_*uga 4 mysql replication master slave

我在两台计算机之间创建了一个复制(我用来在我的数据库中添加新数据的笔记本电脑和一台保存我在笔记本电脑上做的所有事情的服务器),它运行正常.但今天,我的笔记本电脑在线,所以我无法更新我的服务器.结果:我更新了一些行,我创建了很多行,当我的笔记本电脑重新上线时,复制不适用于我一直在离线工作的数据.

任何人都可以给我一个建议来更新我在没有连接时在笔记本电脑上修改过的数据(在服务器上)吗?我不明白为什么它不起作用!

谢谢 !

更新:这是我的show slave状态:

    mysql> show slave status;
+----------------------------------+-------------+-------------+-------------+--
-------------+------------------+---------------------+-------------------------
---+---------------+-----------------------+------------------+-----------------
--+-----------------+---------------------+--------------------+----------------
--------+-------------------------+-----------------------------+------------+--
----------+--------------+---------------------+-----------------+--------------
---+----------------+---------------+--------------------+--------------------+-
-------------------+-----------------+-------------------+----------------+-----
------------------+-------------------------------+---------------+-------------
--+----------------+----------------+-----------------------------+-------------
-----+
| Slave_IO_State                   | Master_Host | Master_User | Master_Port | C
onnect_Retry | Master_Log_File  | Read_Master_Log_Pos | Relay_Log_File
   | Relay_Log_Pos | Relay_Master_Log_File | Slave_IO_Running | Slave_SQL_Runnin
g | Replicate_Do_DB | Replicate_Ignore_DB | Replicate_Do_Table | Replicate_Ignor
e_Table | Replicate_Wild_Do_Table | Replicate_Wild_Ignore_Table | Last_Errno | L
ast_Error | Skip_Counter | Exec_Master_Log_Pos | Relay_Log_Space | Until_Conditi
on | Until_Log_File | Until_Log_Pos | Master_SSL_Allowed | Master_SSL_CA_File |
Master_SSL_CA_Path | Master_SSL_Cert | Master_SSL_Cipher | Master_SSL_Key | Seco
nds_Behind_Master | Master_SSL_Verify_Server_Cert | Last_IO_Errno | Last_IO_Erro
r | Last_SQL_Errno | Last_SQL_Error | Replicate_Ignore_Server_Ids | Master_Serve
r_Id |
+----------------------------------+-------------+-------------+-------------+--
-------------+------------------+---------------------+-------------------------
---+---------------+-----------------------+------------------+-----------------
--+-----------------+---------------------+--------------------+----------------
--------+-------------------------+-----------------------------+------------+--
----------+--------------+---------------------+-----------------+--------------
---+----------------+---------------+--------------------+--------------------+-
-------------------+-----------------+-------------------+----------------+-----
------------------+-------------------------------+---------------+-------------
--+----------------+----------------+-----------------------------+-------------
-----+
| Waiting for master to send event | ***.***.***.*** | masterRepli |        3306 |
          60 | mysql-bin.000027 |              454717 | aofr19072-relay-bin.0000
02 |          1227 | mysql-bin.000027      | Yes              | Yes
  |                 |                     |                    |
        |                         |                             |          0 |
          |            0 |              454717 |            1387 | None
   |                |             0 | No                 |                    |
                   |                 |                   |                |
                0 | No                            |             0 |
  |              0 |                |                             |
   2 |
+----------------------------------+-------------+-------------+-------------+--
-------------+------------------+---------------------+-------------------------
---+---------------+-----------------------+------------------+-----------------
--+-----------------+---------------------+--------------------+----------------
--------+-------------------------+-----------------------------+------------+--
----------+--------------+---------------------+-----------------+--------------
---+----------------+---------------+--------------------+--------------------+-
-------------------+-----------------+-------------------+----------------+-----
------------------+-------------------------------+---------------+-------------
--+----------------+----------------+-----------------------------+-------------
-----+
1 row in set (0.00 sec)
Run Code Online (Sandbox Code Playgroud)

Rol*_*DBA 6

BRUTE FORCE SYNC

我写了一个关于如何在循环复制设置中将Slave重新同步到其Master的详细描述

精密罢工同步

如果您只是想查找差异并仅更新差异,则必须使用mk-table-checksum和mk-table-sync.

试试看 !!!