4

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

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

谢谢 !

更新:这是我的显示奴隶状态:

    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)
4

2 回答 2

6

蛮力同步

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

精确打击同步

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

试试看 !!!

于 2011-10-31T16:53:49.900 回答
2

从服务器是否有可能没有运行从属进程?

SHOW SLAVE STATUS;通过在从属服务器上的 MySQL 命令提示符下键入来查看从属进程是否正在运行。

然后尝试使用START SLAVE;

如果它仍然无法正常工作,请发布SHOW SLAVE STATUS;命令的输出,我们会尽力为您提供进一步帮助 :)

于 2011-10-31T16:30:08.443 回答