开发者

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

开发者 https://www.devze.com 2022-12-17 04:57 出处:网络
One server increment 1, 3, 5. The othe开发者_Go百科r server increment 2, 4, 6Based on this insightful tutorial: http://www.howtoforge.com/mysql_master_master_replication#comment-12927

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

精彩评论

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