MySQLでマルチマスタやシャーディングなどを行った場合、auto_incrementを使いたい場合があります。 たとえばspiderだとすると、複数台のSpiderノードを経由してデータが投入されると、データノードでauto_increment値が競合してしまうことがあるため、auto_incrementのオフセットをspiderノードごとにずらします。 ■spider1 /etc/my.cnf ------ [mysqld] auto_increment_increment = 100 auto_increment_offset = 1 ■spider2 /etc/my.cnf ------ [mysqld] auto_increment_increment = 100 auto_increment_offset = 2 auto_increment_incrementはカウントアップ