* MySQL Replication默認都是異步(asynchronous),當主庫在執行完一些事務后,是不會管備庫的進度的。如果備庫不幸落后,而更不幸的是主庫此時又出現Crash(例如宕機),這時備庫中的數據就是不完整的。簡而言之,在主庫發生故障的時候,我們無法使用備庫來繼續提供數據一致的服務了。
mysql> update mytest.users set name='seasea' where id = 3; Query OK, 1 row affected (0.01 sec) Rows matched: 1 Changed: 1 Warnings: 0
mysql> select * from mytest.users; +----+--------+-----+-----+ | id | name | sex | age | +----+--------+-----+-----+ | 1 | tom | M | 24 | | 2 | jak | F | 32 | | 3 | seasea | M | 35 | | 4 | lisea | M | 29 | | 5 | test | M | 42 | +----+--------+-----+-----+ 5 rows in set (0.00 sec) * slave上查看
mysql> select * from mytest.users; +----+--------+-----+-----+ | id | name | sex | age | +----+--------+-----+-----+ | 1 | tom | M | 24 | | 2 | jak | F | 32 | | 3 | seasea | M | 35 | | 4 | lisea | M | 29 | | 5 | test | M | 42 | +----+--------+-----+-----+ 5 rows in set (0.00 sec) 6. 總結