Search code examples
mysqlmamp

How to find server id with MAMP


MySQL manual holds that the function UUID_SHORT() is guaranteed to be unique if the following conditions hold (list not extensive):

  1. The server_id of the current host is unique among your set of master and slave servers

  2. server_id is between 0 and 255

I'm using UUID_SHORT() on several MAMP servers.

How do I set, or where can I see server_id value with MAMP?

Thanks!


Solution

  • You can view system variables with SHOW VARIABLES:

    SHOW VARIABLES LIKE "server_id";
    

    Since, server_id is dynamic, you can set the variable with SET:

    SET GLOBAL server_id=1