开发者

In a master-master setup, what command or files do I edit so that it can auto-increment by 2?

One server increment 1, 3, 5.

The othe开发者_Go百科r server increment 2, 4, 6


Based on this insightful tutorial: http://www.howtoforge.com/mysql_master_master_replication#comment-12927

Make Master 1 only auto-increment odd numbers by adding this to my.cnf under [mysqld]:

auto_increment_increment= 2
auto_increment_offset   = 1

Make Master 2 only auto-increment even numbers by adding this to my.cnf under [mysqld]:

auto_increment_increment= 2
auto_increment_offset   = 2
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜