Skip to content

Roger Hosto

Good Talk

Menu
  • Home
  • Blogs
    • Databases Administration
      • MySQL
      • NoSQL
    • Development
    • Open Source Software
    • System Administration
  • Resume
  • About
Menu

Coming up with a unique MySQL server-id

Posted on September 22, 2010 by webgeek

The server-id, is used in replication to give each master and slave a unique identity. For each server participating in replication, you should pick a positive integer in the range from 1 to 2^32 – 1 to act as that server’s ID. To come up with this id convert the IP address of the server to an integer as follows

IP address 10.8.208.31

First Octet: 10
Second Octet: 8
Third Octet: 208
Fourth Octet: 31

(first octet * 256^3) + (second octet * 256^2) + (third octet * 256) + (fourth octet)
server-id = (10 * 16777216) + (8 * 65536) + (208 * 256) + (31)
server-id = 168349727

Category: Databases Administration

Leave a Reply

You must be logged in to post a comment.

  • Back to Basics: ORM and Its Impact on Database and Data Architecture
  • MySQL Error: 1062 'Duplicate entry' Error
  • Installing MariaDB 10.1 on CentOS 6.8
  • Linux Mint
  • Querying Apache Hadoop Resource Manager with Python.
  • LinkedIn
© 2026 Roger Hosto | Powered by Minimalist Blog WordPress Theme